From b47942be4c9ab5f447fc744d16f37b62fc8f18be Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 16 Mar 2021 02:49:31 +0000 Subject: [PATCH 1/2] [Automation] External Change --- eng/versioning/version_client.txt | 1 + pom.xml | 3 +- sdk/apimanagement/ci.yml | 33 +++++++++++++++++++ sdk/apimanagement/pom.xml | 53 +++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 sdk/apimanagement/ci.yml create mode 100644 sdk/apimanagement/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 3202d3b0f215f..c0d601b4d5d2e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -210,6 +210,7 @@ com.azure.resourcemanager:azure-resourcemanager-redisenterprise;1.0.0-beta.2;1.0 com.azure.resourcemanager:azure-resourcemanager-hybridkubernetes;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-iothub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-datadog;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-apimanagement;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 f511c48002b32..24598ecf2d52f 100644 --- a/pom.xml +++ b/pom.xml @@ -582,6 +582,7 @@ eng/code-quality-reports eng/jacoco-test-coverage sdk/anomalydetector + sdk/apimanagement sdk/appconfiguration sdk/attestation sdk/authorization @@ -593,8 +594,8 @@ sdk/core sdk/cosmos sdk/costmanagement - sdk/deviceupdate sdk/datadog + sdk/deviceupdate sdk/digitaltwins sdk/eventgrid sdk/eventhubs diff --git a/sdk/apimanagement/ci.yml b/sdk/apimanagement/ci.yml new file mode 100644 index 0000000000000..190cadee56e7e --- /dev/null +++ b/sdk/apimanagement/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/apimanagement/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: apimanagement + Artifacts: + - name: azure-resourcemanager-apimanagement + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerapimanagement diff --git a/sdk/apimanagement/pom.xml b/sdk/apimanagement/pom.xml new file mode 100644 index 0000000000000..f56caab02bd7f --- /dev/null +++ b/sdk/apimanagement/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-apimanagement-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-apimanagement + + + + From 496c10a474d72179b4ccfda903ef96eb92e0761a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 16 Mar 2021 02:49:41 +0000 Subject: [PATCH 2/2] [Automation] Generate Fluent Lite from apimanagement#package-2020-12 --- .../CHANGELOG.md | 5 + .../README.md | 99 + .../pom.xml | 67 + .../apimanagement/ApiManagementManager.java | 1074 ++++ .../fluent/ApiDiagnosticsClient.java | 255 + .../fluent/ApiExportsClient.java | 62 + .../fluent/ApiIssueAttachmentsClient.java | 238 + .../fluent/ApiIssueCommentsClient.java | 223 + .../apimanagement/fluent/ApiIssuesClient.java | 256 + .../fluent/ApiManagementClient.java | 551 ++ .../fluent/ApiManagementOperationsClient.java | 36 + .../ApiManagementServiceSkusClient.java | 42 + .../fluent/ApiManagementServicesClient.java | 600 ++ .../fluent/ApiManagementSkusClient.java | 36 + .../fluent/ApiOperationPoliciesClient.java | 250 + .../fluent/ApiOperationsClient.java | 284 + .../fluent/ApiPoliciesClient.java | 212 + .../fluent/ApiProductsClient.java | 55 + .../fluent/ApiReleasesClient.java | 254 + .../fluent/ApiRevisionsClient.java | 55 + .../fluent/ApiSchemasClient.java | 289 + .../fluent/ApiTagDescriptionsClient.java | 229 + .../fluent/ApiVersionSetsClient.java | 225 + .../apimanagement/fluent/ApisClient.java | 368 ++ .../fluent/AuthorizationServersClient.java | 258 + .../apimanagement/fluent/BackendsClient.java | 265 + .../apimanagement/fluent/CachesClient.java | 229 + .../fluent/CertificatesClient.java | 234 + .../fluent/ContentItemsClient.java | 190 + .../fluent/ContentTypesClient.java | 137 + .../fluent/DelegationSettingsClient.java | 170 + .../fluent/DeletedServicesClient.java | 122 + .../fluent/DiagnosticsClient.java | 225 + .../fluent/EmailTemplatesClient.java | 230 + .../fluent/GatewayApisClient.java | 165 + .../GatewayCertificateAuthoritiesClient.java | 225 + .../GatewayHostnameConfigurationsClient.java | 213 + .../apimanagement/fluent/GatewaysClient.java | 353 ++ .../fluent/GroupUsersClient.java | 156 + .../apimanagement/fluent/GroupsClient.java | 225 + .../fluent/IdentityProvidersClient.java | 264 + .../apimanagement/fluent/IssuesClient.java | 82 + .../apimanagement/fluent/LoggersClient.java | 224 + .../fluent/NamedValuesClient.java | 441 ++ .../fluent/NetworkStatusClient.java | 84 + .../NotificationRecipientEmailsClient.java | 144 + .../NotificationRecipientUsersClient.java | 156 + .../fluent/NotificationsClient.java | 112 + .../fluent/OpenIdConnectProvidersClient.java | 257 + .../fluent/OperationsClient.java | 64 + .../apimanagement/fluent/PoliciesClient.java | 181 + .../fluent/PolicyDescriptionsClient.java | 44 + .../fluent/PortalRevisionsClient.java | 288 + .../fluent/PortalSettingsClient.java | 42 + .../fluent/ProductApisClient.java | 160 + .../fluent/ProductGroupsClient.java | 151 + .../fluent/ProductPoliciesClient.java | 202 + .../fluent/ProductSubscriptionsClient.java | 62 + .../apimanagement/fluent/ProductsClient.java | 291 + .../fluent/QuotaByCounterKeysClient.java | 101 + .../fluent/QuotaByPeriodKeysClient.java | 108 + .../apimanagement/fluent/RegionsClient.java | 41 + .../apimanagement/fluent/ReportsClient.java | 457 ++ .../fluent/SignInSettingsClient.java | 140 + .../fluent/SignUpSettingsClient.java | 140 + .../fluent/SubscriptionsClient.java | 351 ++ .../fluent/TagResourcesClient.java | 58 + .../apimanagement/fluent/TagsClient.java | 784 +++ .../fluent/TenantAccessClient.java | 288 + .../fluent/TenantAccessGitsClient.java | 72 + .../fluent/TenantConfigurationsClient.java | 303 + .../fluent/TenantSettingsClient.java | 75 + .../UserConfirmationPasswordsClient.java | 45 + .../fluent/UserGroupsClient.java | 57 + .../fluent/UserIdentitiesClient.java | 44 + .../fluent/UserSubscriptionsClient.java | 96 + .../apimanagement/fluent/UsersClient.java | 317 ++ .../AccessInformationContractInner.java | 105 + ...AccessInformationSecretsContractInner.java | 160 + .../fluent/models/ApiContractInner.java | 516 ++ .../fluent/models/ApiExportResultInner.java | 110 + ...tDomainOwnershipIdentifierResultInner.java | 41 + ...nagementServiceGetSsoTokenResultInner.java | 50 + ...entServiceNameAvailabilityResultInner.java | 97 + .../ApiManagementServiceResourceInner.java | 836 +++ .../fluent/models/ApiManagementSkuInner.java | 246 + .../models/ApiReleaseContractInner.java | 112 + .../models/ApiRevisionContractInner.java | 151 + .../models/ApiVersionSetContractInner.java | 167 + .../AuthorizationServerContractInner.java | 499 ++ ...thorizationServerSecretsContractInner.java | 108 + .../fluent/models/BackendContractInner.java | 281 + .../fluent/models/CacheContractInner.java | 134 + .../models/CertificateContractInner.java | 140 + .../models/ClientSecretContractInner.java | 50 + .../models/ContentItemContractInner.java | 52 + .../models/ContentTypeContractInner.java | 157 + .../models/DeletedServiceContractInner.java | 129 + .../models/DiagnosticContractInner.java | 279 + .../models/EmailTemplateContractInner.java | 179 + ...ewayCertificateAuthorityContractInner.java | 53 + .../fluent/models/GatewayContractInner.java | 83 + ...wayHostnameConfigurationContractInner.java | 187 + .../models/GatewayKeysContractInner.java | 76 + .../models/GatewayTokenContractInner.java | 50 + .../models/GenerateSsoUrlResultInner.java | 50 + .../fluent/models/GroupContractInner.java | 156 + .../models/IdentityProviderContractInner.java | 305 + .../models/IssueAttachmentContractInner.java | 108 + .../models/IssueCommentContractInner.java | 106 + .../fluent/models/IssueContractInner.java | 185 + .../fluent/models/LoggerContractInner.java | 169 + .../models/NamedValueContractInner.java | 175 + .../models/NamedValueSecretContractInner.java | 50 + .../NetworkStatusContractByLocationInner.java | 79 + .../models/NetworkStatusContractInner.java | 95 + .../models/NotificationContractInner.java | 109 + .../OpenidConnectProviderContractInner.java | 157 + .../fluent/models/OperationContractInner.java | 255 + .../fluent/models/OperationInner.java | 132 + .../models/OperationResultContractInner.java | 220 + .../fluent/models/PolicyCollectionInner.java | 106 + .../fluent/models/PolicyContractInner.java | 80 + .../PolicyDescriptionCollectionInner.java | 81 + .../models/PortalDelegationSettingsInner.java | 143 + .../models/PortalRevisionContractInner.java | 141 + ...rtalSettingValidationKeyContractInner.java | 50 + .../models/PortalSettingsCollectionInner.java | 81 + .../models/PortalSigninSettingsInner.java | 53 + .../models/PortalSignupSettingsInner.java | 83 + .../fluent/models/ProductContractInner.java | 252 + .../models/QuotaCounterCollectionInner.java | 106 + .../models/QuotaCounterContractInner.java | 194 + .../models/RecipientEmailCollectionInner.java | 106 + .../models/RecipientEmailContractInner.java | 53 + .../models/RecipientUserCollectionInner.java | 106 + .../models/RecipientUserContractInner.java | 53 + .../fluent/models/RegionContractInner.java | 91 + .../models/ReportRecordContractInner.java | 700 +++ .../RequestReportRecordContractInner.java | 483 ++ .../fluent/models/ResourceSkuResultInner.java | 77 + .../fluent/models/SchemaContractInner.java | 125 + .../models/SubscriptionContractInner.java | 425 ++ .../models/SubscriptionKeysContractInner.java | 76 + .../fluent/models/TagContractInner.java | 53 + .../models/TagDescriptionContractInner.java | 157 + .../models/TagResourceContractInner.java | 148 + ...ntConfigurationSyncStateContractInner.java | 220 + .../models/TenantSettingsContractInner.java | 54 + .../fluent/models/UserContractInner.java | 242 + .../models/UserIdentityContractInner.java | 76 + .../fluent/models/UserTokenResultInner.java | 50 + .../fluent/models/package-info.java | 6 + .../apimanagement/fluent/package-info.java | 6 + .../AccessInformationContractImpl.java | 231 + .../AccessInformationSecretsContractImpl.java | 49 + .../implementation/ApiContractImpl.java | 421 ++ .../ApiDiagnosticsClientImpl.java | 1577 +++++ .../implementation/ApiDiagnosticsImpl.java | 248 + .../implementation/ApiExportResultImpl.java | 42 + .../implementation/ApiExportsClientImpl.java | 292 + .../implementation/ApiExportsImpl.java | 69 + .../ApiIssueAttachmentsClientImpl.java | 1460 +++++ .../ApiIssueAttachmentsImpl.java | 303 + .../ApiIssueCommentsClientImpl.java | 1425 +++++ .../implementation/ApiIssueCommentsImpl.java | 285 + .../implementation/ApiIssuesClientImpl.java | 1638 ++++++ .../implementation/ApiIssuesImpl.java | 253 + .../ApiManagementClientBuilder.java | 149 + .../ApiManagementClientImpl.java | 1292 +++++ .../ApiManagementOperationsClientImpl.java | 270 + .../ApiManagementOperationsImpl.java | 47 + ...etDomainOwnershipIdentifierResultImpl.java | 34 + ...anagementServiceGetSsoTokenResultImpl.java | 33 + ...mentServiceNameAvailabilityResultImpl.java | 43 + .../ApiManagementServiceResourceImpl.java | 528 ++ .../ApiManagementServiceSkusClientImpl.java | 343 ++ .../ApiManagementServiceSkusImpl.java | 50 + .../ApiManagementServicesClientImpl.java | 3049 ++++++++++ .../ApiManagementServicesImpl.java | 355 ++ .../implementation/ApiManagementSkuImpl.java | 118 + .../ApiManagementSkusClientImpl.java | 294 + .../implementation/ApiManagementSkusImpl.java | 47 + .../ApiOperationPoliciesClientImpl.java | 1345 +++++ .../ApiOperationPoliciesImpl.java | 315 + .../ApiOperationsClientImpl.java | 1677 ++++++ .../implementation/ApiOperationsImpl.java | 248 + .../implementation/ApiPoliciesClientImpl.java | 1192 ++++ .../implementation/ApiPoliciesImpl.java | 159 + .../implementation/ApiProductsClientImpl.java | 431 ++ .../implementation/ApiProductsImpl.java | 55 + .../ApiReleaseContractImpl.java | 183 + .../implementation/ApiReleasesClientImpl.java | 1577 +++++ .../implementation/ApiReleasesImpl.java | 240 + .../ApiRevisionContractImpl.java | 62 + .../ApiRevisionsClientImpl.java | 434 ++ .../implementation/ApiRevisionsImpl.java | 56 + .../implementation/ApiSchemasClientImpl.java | 1535 +++++ .../implementation/ApiSchemasImpl.java | 247 + .../ApiTagDescriptionsClientImpl.java | 1389 +++++ .../ApiTagDescriptionsImpl.java | 256 + .../ApiVersionSetContractImpl.java | 228 + .../ApiVersionSetsClientImpl.java | 1433 +++++ .../implementation/ApiVersionSetsImpl.java | 206 + .../implementation/ApisClientImpl.java | 2132 +++++++ .../implementation/ApisImpl.java | 242 + .../AuthorizationServerContractImpl.java | 427 ++ ...uthorizationServerSecretsContractImpl.java | 41 + .../AuthorizationServersClientImpl.java | 1626 ++++++ .../AuthorizationServersImpl.java | 243 + .../implementation/BackendContractImpl.java | 296 + .../implementation/BackendsClientImpl.java | 1663 ++++++ .../implementation/BackendsImpl.java | 217 + .../implementation/CacheContractImpl.java | 209 + .../implementation/CachesClientImpl.java | 1430 +++++ .../implementation/CachesImpl.java | 201 + .../CertificateContractImpl.java | 219 + .../CertificatesClientImpl.java | 1475 +++++ .../implementation/CertificatesImpl.java | 235 + .../ClientSecretContractImpl.java | 33 + .../ContentItemContractImpl.java | 52 + .../ContentItemsClientImpl.java | 1199 ++++ .../implementation/ContentItemsImpl.java | 140 + .../ContentTypeContractImpl.java | 61 + .../ContentTypesClientImpl.java | 924 +++ .../implementation/ContentTypesImpl.java | 111 + .../DelegationSettingsClientImpl.java | 977 ++++ .../DelegationSettingsImpl.java | 143 + .../DeletedServiceContractImpl.java | 58 + .../DeletedServicesClientImpl.java | 716 +++ .../implementation/DeletedServicesImpl.java | 91 + .../DiagnosticContractImpl.java | 243 + .../implementation/DiagnosticsClientImpl.java | 1436 +++++ .../implementation/DiagnosticsImpl.java | 163 + .../EmailTemplateContractImpl.java | 243 + .../EmailTemplatesClientImpl.java | 1445 +++++ .../implementation/EmailTemplatesImpl.java | 203 + .../implementation/GatewayApisClientImpl.java | 1076 ++++ .../implementation/GatewayApisImpl.java | 107 + ...tewayCertificateAuthoritiesClientImpl.java | 1373 +++++ .../GatewayCertificateAuthoritiesImpl.java | 264 + ...tewayCertificateAuthorityContractImpl.java | 181 + .../implementation/GatewayContractImpl.java | 203 + ...ewayHostnameConfigurationContractImpl.java | 214 + ...tewayHostnameConfigurationsClientImpl.java | 1341 +++++ .../GatewayHostnameConfigurationsImpl.java | 254 + .../GatewayKeysContractImpl.java | 37 + .../GatewayTokenContractImpl.java | 33 + .../implementation/GatewaysClientImpl.java | 2082 +++++++ .../implementation/GatewaysImpl.java | 282 + .../GenerateSsoUrlResultImpl.java | 33 + .../implementation/GroupContractImpl.java | 218 + .../implementation/GroupUsersClientImpl.java | 1033 ++++ .../implementation/GroupUsersImpl.java | 100 + .../implementation/GroupsClientImpl.java | 1443 +++++ .../implementation/GroupsImpl.java | 201 + .../IdentityProviderContractImpl.java | 322 ++ .../IdentityProvidersClientImpl.java | 1598 ++++++ .../implementation/IdentityProvidersImpl.java | 257 + .../IssueAttachmentContractImpl.java | 217 + .../IssueCommentContractImpl.java | 217 + .../implementation/IssueContractImpl.java | 248 + .../implementation/IssuesClientImpl.java | 593 ++ .../implementation/IssuesImpl.java | 74 + .../implementation/LoggerContractImpl.java | 226 + .../implementation/LoggersClientImpl.java | 1436 +++++ .../implementation/LoggersImpl.java | 201 + .../NamedValueContractImpl.java | 252 + .../NamedValueSecretContractImpl.java | 33 + .../implementation/NamedValuesClientImpl.java | 2255 ++++++++ .../implementation/NamedValuesImpl.java | 258 + .../NetworkStatusClientImpl.java | 429 ++ .../NetworkStatusContractByLocationImpl.java | 44 + .../NetworkStatusContractImpl.java | 50 + .../implementation/NetworkStatusImpl.java | 101 + .../NotificationContractImpl.java | 54 + ...NotificationRecipientEmailsClientImpl.java | 856 +++ .../NotificationRecipientEmailsImpl.java | 132 + .../NotificationRecipientUsersClientImpl.java | 856 +++ .../NotificationRecipientUsersImpl.java | 132 + .../NotificationsClientImpl.java | 786 +++ .../implementation/NotificationsImpl.java | 108 + .../OpenIdConnectProvidersClientImpl.java | 1626 ++++++ .../OpenIdConnectProvidersImpl.java | 241 + .../OpenidConnectProviderContractImpl.java | 239 + .../implementation/OperationContractImpl.java | 287 + .../implementation/OperationImpl.java | 45 + .../OperationResultContractImpl.java | 68 + .../implementation/OperationsClientImpl.java | 499 ++ .../implementation/OperationsImpl.java | 59 + .../implementation/PoliciesClientImpl.java | 1062 ++++ .../implementation/PoliciesImpl.java | 144 + .../implementation/PolicyCollectionImpl.java | 56 + .../implementation/PolicyContractImpl.java | 211 + .../PolicyDescriptionCollectionImpl.java | 45 + .../PolicyDescriptionsClientImpl.java | 255 + .../PolicyDescriptionsImpl.java | 63 + .../PortalDelegationSettingsImpl.java | 59 + .../PortalRevisionContractImpl.java | 170 + .../PortalRevisionsClientImpl.java | 1508 +++++ .../implementation/PortalRevisionsImpl.java | 143 + ...ortalSettingValidationKeyContractImpl.java | 33 + .../PortalSettingsClientImpl.java | 221 + .../PortalSettingsCollectionImpl.java | 45 + .../implementation/PortalSettingsImpl.java | 61 + .../PortalSigninSettingsImpl.java | 45 + .../PortalSignupSettingsImpl.java | 50 + .../implementation/ProductApisClientImpl.java | 1034 ++++ .../implementation/ProductApisImpl.java | 101 + .../implementation/ProductContractImpl.java | 252 + .../ProductGroupsClientImpl.java | 1004 ++++ .../implementation/ProductGroupsImpl.java | 105 + .../ProductPoliciesClientImpl.java | 1173 ++++ .../implementation/ProductPoliciesImpl.java | 162 + .../ProductSubscriptionsClientImpl.java | 468 ++ .../ProductSubscriptionsImpl.java | 56 + .../implementation/ProductsClientImpl.java | 1957 +++++++ .../implementation/ProductsImpl.java | 245 + .../QuotaByCounterKeysClientImpl.java | 499 ++ .../QuotaByCounterKeysImpl.java | 99 + .../QuotaByPeriodKeysClientImpl.java | 534 ++ .../implementation/QuotaByPeriodKeysImpl.java | 105 + .../QuotaCounterCollectionImpl.java | 56 + .../QuotaCounterContractImpl.java | 51 + .../RecipientEmailCollectionImpl.java | 56 + .../RecipientEmailContractImpl.java | 45 + .../RecipientUserCollectionImpl.java | 56 + .../RecipientUserContractImpl.java | 45 + .../implementation/RegionContractImpl.java | 40 + .../implementation/RegionsClientImpl.java | 338 ++ .../implementation/RegionsImpl.java | 47 + .../ReportRecordContractImpl.java | 134 + .../implementation/ReportsClientImpl.java | 3316 +++++++++++ .../implementation/ReportsImpl.java | 189 + .../RequestReportRecordContractImpl.java | 102 + .../implementation/ResourceSkuResultImpl.java | 43 + .../implementation/SchemaContractImpl.java | 177 + .../SignInSettingsClientImpl.java | 810 +++ .../implementation/SignInSettingsImpl.java | 115 + .../SignUpSettingsClientImpl.java | 810 +++ .../implementation/SignUpSettingsImpl.java | 115 + .../SubscriptionContractImpl.java | 95 + .../SubscriptionKeysContractImpl.java | 37 + .../SubscriptionsClientImpl.java | 2140 +++++++ .../implementation/SubscriptionsImpl.java | 214 + .../implementation/TagContractImpl.java | 170 + .../TagDescriptionContractImpl.java | 226 + .../TagResourceContractImpl.java | 49 + .../TagResourcesClientImpl.java | 452 ++ .../implementation/TagResourcesImpl.java | 49 + .../implementation/TagsClientImpl.java | 5047 +++++++++++++++++ .../implementation/TagsImpl.java | 485 ++ .../TenantAccessClientImpl.java | 1732 ++++++ .../TenantAccessGitsClientImpl.java | 399 ++ .../implementation/TenantAccessGitsImpl.java | 58 + .../implementation/TenantAccessImpl.java | 191 + ...antConfigurationSyncStateContractImpl.java | 58 + .../TenantConfigurationsClientImpl.java | 1311 +++++ .../TenantConfigurationsImpl.java | 156 + .../TenantSettingsClientImpl.java | 549 ++ .../TenantSettingsContractImpl.java | 52 + .../implementation/TenantSettingsImpl.java | 76 + .../UserConfirmationPasswordsClientImpl.java | 259 + .../UserConfirmationPasswordsImpl.java | 45 + .../implementation/UserContractImpl.java | 324 ++ .../implementation/UserGroupsClientImpl.java | 440 ++ .../implementation/UserGroupsImpl.java | 54 + .../UserIdentitiesClientImpl.java | 354 ++ .../implementation/UserIdentitiesImpl.java | 49 + .../UserIdentityContractImpl.java | 37 + .../UserSubscriptionsClientImpl.java | 660 +++ .../implementation/UserSubscriptionsImpl.java | 82 + .../implementation/UserTokenResultImpl.java | 32 + .../implementation/UsersClientImpl.java | 1959 +++++++ .../implementation/UsersImpl.java | 293 + .../apimanagement/implementation/Utils.java | 204 + .../implementation/package-info.java | 6 + .../apimanagement/models/AccessIdName.java | 34 + .../models/AccessInformationCollection.java | 85 + .../models/AccessInformationContract.java | 285 + .../AccessInformationCreateParameters.java | 136 + .../AccessInformationSecretsContract.java | 55 + .../AccessInformationUpdateParameters.java | 52 + .../models/AdditionalLocation.java | 229 + .../apimanagement/models/AlwaysLog.java | 31 + .../apimanagement/models/ApiCollection.java | 85 + .../apimanagement/models/ApiContract.java | 702 +++ .../models/ApiContractProperties.java | 279 + .../models/ApiContractUpdateProperties.java | 217 + .../models/ApiCreateOrUpdateParameter.java | 622 ++ .../models/ApiCreateOrUpdateProperties.java | 259 + ...iCreateOrUpdatePropertiesWsdlSelector.java | 76 + .../apimanagement/models/ApiDiagnostics.java | 203 + .../ApiDiagnosticsCreateOrUpdateHeaders.java | 50 + .../ApiDiagnosticsCreateOrUpdateResponse.java | 38 + .../ApiDiagnosticsGetEntityTagHeaders.java | 50 + .../ApiDiagnosticsGetEntityTagResponse.java | 30 + .../models/ApiDiagnosticsGetHeaders.java | 50 + .../models/ApiDiagnosticsGetResponse.java | 37 + .../models/ApiDiagnosticsUpdateHeaders.java | 50 + .../models/ApiDiagnosticsUpdateResponse.java | 38 + .../models/ApiEntityBaseContract.java | 338 ++ .../apimanagement/models/ApiExportResult.java | 39 + .../models/ApiExportResultValue.java | 53 + .../apimanagement/models/ApiExports.java | 55 + .../models/ApiIssueAttachments.java | 232 + ...IssueAttachmentsCreateOrUpdateHeaders.java | 50 + ...ssueAttachmentsCreateOrUpdateResponse.java | 38 + ...piIssueAttachmentsGetEntityTagHeaders.java | 50 + ...iIssueAttachmentsGetEntityTagResponse.java | 31 + .../models/ApiIssueAttachmentsGetHeaders.java | 50 + .../ApiIssueAttachmentsGetResponse.java | 38 + .../models/ApiIssueComments.java | 217 + ...ApiIssueCommentsCreateOrUpdateHeaders.java | 50 + ...piIssueCommentsCreateOrUpdateResponse.java | 38 + .../ApiIssueCommentsGetEntityTagHeaders.java | 50 + .../ApiIssueCommentsGetEntityTagResponse.java | 31 + .../models/ApiIssueCommentsGetHeaders.java | 50 + .../models/ApiIssueCommentsGetResponse.java | 38 + .../apimanagement/models/ApiIssues.java | 208 + .../ApiIssuesCreateOrUpdateHeaders.java | 50 + .../ApiIssuesCreateOrUpdateResponse.java | 38 + .../models/ApiIssuesGetEntityTagHeaders.java | 50 + .../models/ApiIssuesGetEntityTagResponse.java | 26 + .../models/ApiIssuesGetHeaders.java | 50 + .../models/ApiIssuesGetResponse.java | 37 + .../models/ApiIssuesUpdateHeaders.java | 50 + .../models/ApiIssuesUpdateResponse.java | 37 + .../models/ApiManagementOperations.java | 31 + ...ceApplyNetworkConfigurationParameters.java | 55 + ...agementServiceBackupRestoreParameters.java | 156 + .../ApiManagementServiceBaseProperties.java | 615 ++ ...erviceCheckNameAvailabilityParameters.java | 57 + ...iceGetDomainOwnershipIdentifierResult.java | 26 + ...ApiManagementServiceGetSsoTokenResult.java | 25 + .../models/ApiManagementServiceIdentity.java | 142 + .../ApiManagementServiceListResult.java | 89 + ...nagementServiceNameAvailabilityResult.java | 44 + .../ApiManagementServiceProperties.java | 171 + .../models/ApiManagementServiceResource.java | 992 ++++ .../ApiManagementServiceSkuProperties.java | 85 + .../models/ApiManagementServiceSkus.java | 37 + .../ApiManagementServiceUpdateParameters.java | 751 +++ .../ApiManagementServiceUpdateProperties.java | 159 + .../models/ApiManagementServices.java | 350 ++ .../models/ApiManagementSku.java | 112 + .../models/ApiManagementSkuCapabilities.java | 54 + .../models/ApiManagementSkuCapacity.java | 84 + .../ApiManagementSkuCapacityScaleType.java | 50 + .../models/ApiManagementSkuCosts.java | 69 + .../models/ApiManagementSkuLocationInfo.java | 73 + .../ApiManagementSkuRestrictionInfo.java | 55 + .../models/ApiManagementSkuRestrictions.java | 90 + ...piManagementSkuRestrictionsReasonCode.java | 47 + .../ApiManagementSkuRestrictionsType.java | 47 + .../models/ApiManagementSkuZoneDetails.java | 61 + .../models/ApiManagementSkus.java | 31 + .../models/ApiManagementSkusResult.java | 76 + .../models/ApiOperationPolicies.java | 237 + ...perationPoliciesCreateOrUpdateHeaders.java | 50 + ...erationPoliciesCreateOrUpdateResponse.java | 38 + ...iOperationPoliciesGetEntityTagHeaders.java | 50 + ...OperationPoliciesGetEntityTagResponse.java | 31 + .../ApiOperationPoliciesGetHeaders.java | 50 + .../ApiOperationPoliciesGetResponse.java | 38 + .../apimanagement/models/ApiOperations.java | 223 + .../ApiOperationsCreateOrUpdateHeaders.java | 50 + .../ApiOperationsCreateOrUpdateResponse.java | 38 + .../ApiOperationsGetEntityTagHeaders.java | 50 + .../ApiOperationsGetEntityTagResponse.java | 30 + .../models/ApiOperationsGetHeaders.java | 50 + .../models/ApiOperationsGetResponse.java | 37 + .../models/ApiOperationsUpdateHeaders.java | 50 + .../models/ApiOperationsUpdateResponse.java | 38 + .../apimanagement/models/ApiPolicies.java | 197 + .../ApiPoliciesCreateOrUpdateHeaders.java | 50 + .../ApiPoliciesCreateOrUpdateResponse.java | 38 + .../ApiPoliciesGetEntityTagHeaders.java | 50 + .../ApiPoliciesGetEntityTagResponse.java | 30 + .../models/ApiPoliciesGetHeaders.java | 50 + .../models/ApiPoliciesGetResponse.java | 37 + .../apimanagement/models/ApiProducts.java | 50 + .../models/ApiReleaseCollection.java | 85 + .../models/ApiReleaseContract.java | 218 + .../apimanagement/models/ApiReleases.java | 202 + .../ApiReleasesCreateOrUpdateHeaders.java | 50 + .../ApiReleasesCreateOrUpdateResponse.java | 38 + .../ApiReleasesGetEntityTagHeaders.java | 50 + .../ApiReleasesGetEntityTagResponse.java | 30 + .../models/ApiReleasesGetHeaders.java | 50 + .../models/ApiReleasesGetResponse.java | 37 + .../models/ApiReleasesUpdateHeaders.java | 50 + .../models/ApiReleasesUpdateResponse.java | 37 + .../models/ApiRevisionCollection.java | 85 + .../models/ApiRevisionContract.java | 76 + .../apimanagement/models/ApiRevisions.java | 50 + .../apimanagement/models/ApiSchemas.java | 214 + .../ApiSchemasCreateOrUpdateHeaders.java | 50 + .../ApiSchemasCreateOrUpdateResponse.java | 38 + .../models/ApiSchemasGetEntityTagHeaders.java | 50 + .../ApiSchemasGetEntityTagResponse.java | 30 + .../models/ApiSchemasGetHeaders.java | 50 + .../models/ApiSchemasGetResponse.java | 37 + .../models/ApiTagDescriptions.java | 220 + ...iTagDescriptionsCreateOrUpdateHeaders.java | 50 + ...TagDescriptionsCreateOrUpdateResponse.java | 38 + ...ApiTagDescriptionsGetEntityTagHeaders.java | 50 + ...piTagDescriptionsGetEntityTagResponse.java | 31 + .../models/ApiTagDescriptionsGetHeaders.java | 50 + .../models/ApiTagDescriptionsGetResponse.java | 38 + .../ApiTagResourceContractProperties.java | 243 + .../apimanagement/models/ApiType.java | 34 + .../models/ApiUpdateContract.java | 452 ++ .../models/ApiVersionConstraint.java | 53 + .../models/ApiVersionSetCollection.java | 107 + .../models/ApiVersionSetContract.java | 308 + .../models/ApiVersionSetContractDetails.java | 191 + ...ionSetContractDetailsVersioningScheme.java | 38 + .../ApiVersionSetContractProperties.java | 114 + .../models/ApiVersionSetEntityBase.java | 108 + .../models/ApiVersionSetUpdateParameters.java | 165 + ...iVersionSetUpdateParametersProperties.java | 102 + .../apimanagement/models/ApiVersionSets.java | 183 + .../ApiVersionSetsCreateOrUpdateHeaders.java | 50 + .../ApiVersionSetsCreateOrUpdateResponse.java | 38 + .../ApiVersionSetsGetEntityTagHeaders.java | 50 + .../ApiVersionSetsGetEntityTagResponse.java | 30 + .../models/ApiVersionSetsGetHeaders.java | 50 + .../models/ApiVersionSetsGetResponse.java | 38 + .../models/ApiVersionSetsUpdateHeaders.java | 50 + .../models/ApiVersionSetsUpdateResponse.java | 38 + .../models/ApimIdentityType.java | 40 + .../apimanagement/models/ApimResource.java | 52 + .../apimanagement/models/Apis.java | 252 + .../models/ApisCreateOrUpdateHeaders.java | 50 + .../models/ApisCreateOrUpdateResponse.java | 37 + .../models/ApisGetEntityTagHeaders.java | 50 + .../models/ApisGetEntityTagResponse.java | 26 + .../apimanagement/models/ApisGetHeaders.java | 50 + .../apimanagement/models/ApisGetResponse.java | 33 + .../models/ApisUpdateHeaders.java | 50 + .../models/ApisUpdateResponse.java | 37 + .../apimanagement/models/AppType.java | 34 + .../models/AssociationContract.java | 53 + .../models/AsyncOperationStatus.java | 53 + .../AuthenticationSettingsContract.java | 82 + .../models/AuthorizationMethod.java | 65 + .../models/AuthorizationServerCollection.java | 107 + .../models/AuthorizationServerContract.java | 710 +++ ...orizationServerContractBaseProperties.java | 324 ++ ...AuthorizationServerContractProperties.java | 301 + .../AuthorizationServerSecretsContract.java | 41 + .../AuthorizationServerUpdateContract.java | 494 ++ ...izationServerUpdateContractProperties.java | 270 + .../models/AuthorizationServers.java | 213 + ...orizationServersCreateOrUpdateHeaders.java | 50 + ...rizationServersCreateOrUpdateResponse.java | 38 + ...thorizationServersGetEntityTagHeaders.java | 50 + ...horizationServersGetEntityTagResponse.java | 31 + .../AuthorizationServersGetHeaders.java | 50 + .../AuthorizationServersGetResponse.java | 38 + ...uthorizationServersListSecretsHeaders.java | 50 + ...thorizationServersListSecretsResponse.java | 38 + .../AuthorizationServersUpdateHeaders.java | 50 + .../AuthorizationServersUpdateResponse.java | 38 + ...BackendAuthorizationHeaderCredentials.java | 88 + .../models/BackendBaseParameters.java | 221 + .../models/BackendCollection.java | 107 + .../apimanagement/models/BackendContract.java | 437 ++ .../models/BackendContractProperties.java | 138 + .../models/BackendCredentialsContract.java | 162 + .../models/BackendProperties.java | 53 + .../apimanagement/models/BackendProtocol.java | 34 + .../models/BackendProxyContract.java | 110 + .../models/BackendReconnectContract.java | 57 + ...BackendServiceFabricClusterProperties.java | 199 + .../models/BackendTlsProperties.java | 82 + .../BackendUpdateParameterProperties.java | 127 + .../models/BackendUpdateParameters.java | 275 + .../apimanagement/models/Backends.java | 220 + .../models/BackendsCreateOrUpdateHeaders.java | 50 + .../BackendsCreateOrUpdateResponse.java | 38 + .../models/BackendsGetEntityTagHeaders.java | 50 + .../models/BackendsGetEntityTagResponse.java | 26 + .../models/BackendsGetHeaders.java | 50 + .../models/BackendsGetResponse.java | 37 + .../models/BackendsUpdateHeaders.java | 50 + .../models/BackendsUpdateResponse.java | 37 + .../models/BearerTokenSendingMethod.java | 34 + .../models/BearerTokenSendingMethods.java | 34 + .../models/BodyDiagnosticSettings.java | 50 + .../apimanagement/models/CacheCollection.java | 107 + .../apimanagement/models/CacheContract.java | 269 + .../models/CacheUpdateParameters.java | 133 + .../apimanagement/models/Caches.java | 187 + .../models/CachesCreateOrUpdateHeaders.java | 50 + .../models/CachesCreateOrUpdateResponse.java | 37 + .../models/CachesGetEntityTagHeaders.java | 50 + .../models/CachesGetEntityTagResponse.java | 26 + .../models/CachesGetHeaders.java | 50 + .../models/CachesGetResponse.java | 37 + .../models/CachesUpdateHeaders.java | 50 + .../models/CachesUpdateResponse.java | 37 + .../models/CertificateCollection.java | 107 + .../models/CertificateConfiguration.java | 140 + .../CertificateConfigurationStoreName.java | 34 + .../models/CertificateContract.java | 262 + .../CertificateCreateOrUpdateParameters.java | 108 + .../models/CertificateInformation.java | 122 + .../apimanagement/models/Certificates.java | 231 + .../CertificatesCreateOrUpdateHeaders.java | 50 + .../CertificatesCreateOrUpdateResponse.java | 38 + .../CertificatesGetEntityTagHeaders.java | 50 + .../CertificatesGetEntityTagResponse.java | 30 + .../models/CertificatesGetHeaders.java | 50 + .../models/CertificatesGetResponse.java | 37 + .../CertificatesRefreshSecretHeaders.java | 50 + .../CertificatesRefreshSecretResponse.java | 38 + .../models/ClientAuthenticationMethod.java | 34 + .../models/ClientSecretContract.java | 24 + .../models/ConfigurationIdName.java | 31 + .../apimanagement/models/Confirmation.java | 34 + .../models/ConnectivityStatusContract.java | 259 + .../models/ConnectivityStatusType.java | 37 + .../apimanagement/models/ContentFormat.java | 58 + .../models/ContentItemCollection.java | 59 + .../models/ContentItemContract.java | 46 + .../apimanagement/models/ContentItems.java | 176 + .../ContentItemsCreateOrUpdateHeaders.java | 50 + .../ContentItemsCreateOrUpdateResponse.java | 38 + .../ContentItemsGetEntityTagHeaders.java | 50 + .../ContentItemsGetEntityTagResponse.java | 30 + .../models/ContentItemsGetHeaders.java | 50 + .../models/ContentItemsGetResponse.java | 37 + .../models/ContentTypeCollection.java | 59 + .../models/ContentTypeContract.java | 73 + .../apimanagement/models/ContentTypes.java | 125 + .../ContentTypesCreateOrUpdateHeaders.java | 50 + .../ContentTypesCreateOrUpdateResponse.java | 38 + .../models/ContentTypesGetHeaders.java | 50 + .../models/ContentTypesGetResponse.java | 37 + .../apimanagement/models/DataMasking.java | 83 + .../models/DataMaskingEntity.java | 77 + .../apimanagement/models/DataMaskingMode.java | 34 + .../models/DelegationSettings.java | 156 + ...DelegationSettingsGetEntityTagHeaders.java | 50 + ...elegationSettingsGetEntityTagResponse.java | 31 + .../models/DelegationSettingsGetHeaders.java | 50 + .../models/DelegationSettingsGetResponse.java | 38 + .../models/DeletedServiceContract.java | 69 + .../apimanagement/models/DeletedServices.java | 82 + .../models/DeletedServicesCollection.java | 59 + .../models/DeployConfigurationParameters.java | 82 + .../models/DiagnosticCollection.java | 107 + .../models/DiagnosticContract.java | 419 ++ .../apimanagement/models/Diagnostics.java | 211 + .../DiagnosticsCreateOrUpdateHeaders.java | 50 + .../DiagnosticsCreateOrUpdateResponse.java | 38 + .../DiagnosticsGetEntityTagHeaders.java | 50 + .../DiagnosticsGetEntityTagResponse.java | 30 + .../models/DiagnosticsGetHeaders.java | 50 + .../models/DiagnosticsGetResponse.java | 37 + .../models/DiagnosticsUpdateHeaders.java | 50 + .../models/DiagnosticsUpdateResponse.java | 37 + .../models/EmailTemplateCollection.java | 107 + .../models/EmailTemplateContract.java | 302 + ...lTemplateParametersContractProperties.java | 102 + .../models/EmailTemplateUpdateParameters.java | 160 + .../apimanagement/models/EmailTemplates.java | 184 + .../EmailTemplatesGetEntityTagHeaders.java | 50 + .../EmailTemplatesGetEntityTagResponse.java | 30 + .../models/EmailTemplatesGetHeaders.java | 50 + .../models/EmailTemplatesGetResponse.java | 38 + .../models/EmailTemplatesUpdateHeaders.java | 50 + .../models/EmailTemplatesUpdateResponse.java | 38 + .../models/ErrorFieldContract.java | 102 + .../models/ErrorResponseBody.java | 109 + .../apimanagement/models/ExportApi.java | 31 + .../apimanagement/models/ExportFormat.java | 43 + .../models/ExportResultFormat.java | 40 + .../apimanagement/models/GatewayApis.java | 153 + .../GatewayApisGetEntityTagHeaders.java | 50 + .../GatewayApisGetEntityTagResponse.java | 30 + .../models/GatewayCertificateAuthorities.java | 219 + ...icateAuthoritiesCreateOrUpdateHeaders.java | 51 + ...cateAuthoritiesCreateOrUpdateResponse.java | 38 + ...ificateAuthoritiesGetEntityTagHeaders.java | 51 + ...ficateAuthoritiesGetEntityTagResponse.java | 31 + ...tewayCertificateAuthoritiesGetHeaders.java | 50 + ...ewayCertificateAuthoritiesGetResponse.java | 38 + ...GatewayCertificateAuthorityCollection.java | 59 + .../GatewayCertificateAuthorityContract.java | 176 + .../models/GatewayCollection.java | 85 + .../apimanagement/models/GatewayContract.java | 267 + ...atewayHostnameConfigurationCollection.java | 59 + .../GatewayHostnameConfigurationContract.java | 335 ++ .../models/GatewayHostnameConfigurations.java | 209 + ...meConfigurationsCreateOrUpdateHeaders.java | 51 + ...eConfigurationsCreateOrUpdateResponse.java | 39 + ...nameConfigurationsGetEntityTagHeaders.java | 51 + ...ameConfigurationsGetEntityTagResponse.java | 31 + ...tewayHostnameConfigurationsGetHeaders.java | 50 + ...ewayHostnameConfigurationsGetResponse.java | 38 + ...GatewayKeyRegenerationRequestContract.java | 56 + .../models/GatewayKeysContract.java | 31 + .../models/GatewayTokenContract.java | 24 + .../models/GatewayTokenRequestContract.java | 94 + .../apimanagement/models/Gateways.java | 298 + .../models/GatewaysCreateOrUpdateHeaders.java | 50 + .../GatewaysCreateOrUpdateResponse.java | 38 + .../models/GatewaysGetEntityTagHeaders.java | 50 + .../models/GatewaysGetEntityTagResponse.java | 26 + .../models/GatewaysGetHeaders.java | 50 + .../models/GatewaysGetResponse.java | 37 + .../models/GatewaysListKeysHeaders.java | 50 + .../models/GatewaysListKeysResponse.java | 37 + .../models/GatewaysUpdateHeaders.java | 50 + .../models/GatewaysUpdateResponse.java | 37 + .../models/GenerateSsoUrlResult.java | 24 + .../apimanagement/models/GrantType.java | 40 + .../apimanagement/models/GroupCollection.java | 107 + .../apimanagement/models/GroupContract.java | 282 + .../models/GroupContractProperties.java | 158 + .../models/GroupCreateParameters.java | 137 + .../apimanagement/models/GroupType.java | 50 + .../models/GroupUpdateParameters.java | 137 + .../apimanagement/models/GroupUsers.java | 145 + .../apimanagement/models/Groups.java | 186 + .../models/GroupsCreateOrUpdateHeaders.java | 50 + .../models/GroupsCreateOrUpdateResponse.java | 37 + .../models/GroupsGetEntityTagHeaders.java | 50 + .../models/GroupsGetEntityTagResponse.java | 26 + .../models/GroupsGetHeaders.java | 50 + .../models/GroupsGetResponse.java | 37 + .../models/GroupsUpdateHeaders.java | 50 + .../models/GroupsUpdateResponse.java | 37 + .../models/HostnameConfiguration.java | 295 + .../apimanagement/models/HostnameType.java | 43 + .../models/HttpCorrelationProtocol.java | 37 + .../models/HttpMessageDiagnostic.java | 109 + .../IdentityProviderBaseParameters.java | 235 + .../models/IdentityProviderContract.java | 487 ++ .../IdentityProviderContractProperties.java | 158 + .../IdentityProviderCreateContract.java | 304 + ...ntityProviderCreateContractProperties.java | 164 + .../models/IdentityProviderList.java | 107 + .../models/IdentityProviderType.java | 46 + .../IdentityProviderUpdateParameters.java | 299 + .../IdentityProviderUpdateProperties.java | 145 + .../models/IdentityProviders.java | 214 + ...dentityProvidersCreateOrUpdateHeaders.java | 50 + ...entityProvidersCreateOrUpdateResponse.java | 38 + .../IdentityProvidersGetEntityTagHeaders.java | 50 + ...IdentityProvidersGetEntityTagResponse.java | 31 + .../models/IdentityProvidersGetHeaders.java | 50 + .../models/IdentityProvidersGetResponse.java | 38 + .../IdentityProvidersListSecretsHeaders.java | 50 + .../IdentityProvidersListSecretsResponse.java | 38 + .../IdentityProvidersUpdateHeaders.java | 50 + .../IdentityProvidersUpdateResponse.java | 38 + .../models/IssueAttachmentCollection.java | 85 + .../models/IssueAttachmentContract.java | 242 + .../apimanagement/models/IssueCollection.java | 85 + .../models/IssueCommentCollection.java | 85 + .../models/IssueCommentContract.java | 235 + .../apimanagement/models/IssueContract.java | 324 ++ .../models/IssueContractBaseProperties.java | 103 + .../models/IssueContractProperties.java | 142 + .../models/IssueUpdateContract.java | 183 + .../models/IssueUpdateContractProperties.java | 126 + .../apimanagement/models/Issues.java | 75 + .../models/IssuesGetHeaders.java | 50 + .../models/IssuesGetResponse.java | 37 + .../apimanagement/models/KeyType.java | 47 + .../KeyVaultContractCreateProperties.java | 83 + .../models/KeyVaultContractProperties.java | 69 + ...ultLastAccessStatusContractProperties.java | 107 + .../models/LoggerCollection.java | 107 + .../apimanagement/models/LoggerContract.java | 294 + .../apimanagement/models/LoggerType.java | 37 + .../models/LoggerUpdateContract.java | 134 + .../apimanagement/models/Loggers.java | 186 + .../models/LoggersCreateOrUpdateHeaders.java | 50 + .../models/LoggersCreateOrUpdateResponse.java | 38 + .../models/LoggersGetEntityTagHeaders.java | 50 + .../models/LoggersGetEntityTagResponse.java | 26 + .../models/LoggersGetHeaders.java | 50 + .../models/LoggersGetResponse.java | 37 + .../models/LoggersUpdateHeaders.java | 50 + .../models/LoggersUpdateResponse.java | 37 + .../models/NameAvailabilityReason.java | 50 + .../models/NamedValueCollection.java | 107 + .../models/NamedValueContract.java | 353 ++ .../models/NamedValueContractProperties.java | 137 + .../models/NamedValueCreateContract.java | 174 + .../NamedValueCreateContractProperties.java | 137 + .../NamedValueEntityBaseParameters.java | 81 + .../models/NamedValueSecretContract.java | 24 + .../NamedValueUpdateParameterProperties.java | 128 + .../models/NamedValueUpdateParameters.java | 170 + .../apimanagement/models/NamedValues.java | 249 + .../NamedValuesCreateOrUpdateHeaders.java | 50 + .../NamedValuesCreateOrUpdateResponse.java | 38 + .../NamedValuesGetEntityTagHeaders.java | 50 + .../NamedValuesGetEntityTagResponse.java | 30 + .../models/NamedValuesGetHeaders.java | 50 + .../models/NamedValuesGetResponse.java | 37 + .../models/NamedValuesListValueHeaders.java | 50 + .../models/NamedValuesListValueResponse.java | 38 + .../NamedValuesRefreshSecretHeaders.java | 50 + .../NamedValuesRefreshSecretResponse.java | 38 + .../models/NamedValuesUpdateHeaders.java | 50 + .../models/NamedValuesUpdateResponse.java | 37 + .../apimanagement/models/NetworkStatus.java | 76 + .../models/NetworkStatusContract.java | 33 + .../NetworkStatusContractByLocation.java | 31 + .../models/NotificationCollection.java | 107 + .../models/NotificationContract.java | 59 + .../models/NotificationName.java | 54 + .../models/NotificationRecipientEmails.java | 131 + .../models/NotificationRecipientUsers.java | 143 + .../apimanagement/models/Notifications.java | 102 + .../OAuth2AuthenticationSettingsContract.java | 76 + .../OpenIdAuthenticationSettingsContract.java | 78 + .../OpenIdConnectProviderCollection.java | 107 + .../models/OpenIdConnectProviders.java | 212 + ...ConnectProvidersCreateOrUpdateHeaders.java | 50 + ...onnectProvidersCreateOrUpdateResponse.java | 38 + ...IdConnectProvidersGetEntityTagHeaders.java | 50 + ...dConnectProvidersGetEntityTagResponse.java | 31 + .../OpenIdConnectProvidersGetHeaders.java | 50 + .../OpenIdConnectProvidersGetResponse.java | 38 + ...nIdConnectProvidersListSecretsHeaders.java | 50 + ...IdConnectProvidersListSecretsResponse.java | 38 + .../OpenIdConnectProvidersUpdateHeaders.java | 50 + .../OpenIdConnectProvidersUpdateResponse.java | 38 + .../models/OpenidConnectProviderContract.java | 314 + .../OpenidConnectProviderUpdateContract.java | 156 + .../apimanagement/models/Operation.java | 45 + .../models/OperationCollection.java | 85 + .../models/OperationContract.java | 393 ++ .../models/OperationContractProperties.java | 165 + .../models/OperationDisplay.java | 128 + .../models/OperationEntityBaseContract.java | 164 + .../models/OperationListResult.java | 84 + .../models/OperationNameFormat.java | 34 + .../models/OperationResultContract.java | 72 + .../OperationResultLogItemContract.java | 102 + ...perationTagResourceContractProperties.java | 160 + .../models/OperationUpdateContract.java | 251 + .../OperationUpdateContractProperties.java | 147 + .../apimanagement/models/Operations.java | 59 + .../models/ParameterContract.java | 191 + .../models/PipelineDiagnosticSettings.java | 82 + .../apimanagement/models/Policies.java | 165 + .../models/PoliciesCreateOrUpdateHeaders.java | 50 + .../PoliciesCreateOrUpdateResponse.java | 38 + .../models/PoliciesGetEntityTagHeaders.java | 50 + .../models/PoliciesGetEntityTagResponse.java | 26 + .../models/PoliciesGetHeaders.java | 50 + .../models/PoliciesGetResponse.java | 37 + .../models/PolicyCollection.java | 39 + .../models/PolicyContentFormat.java | 40 + .../apimanagement/models/PolicyContract.java | 206 + .../models/PolicyDescriptionCollection.java | 32 + .../models/PolicyDescriptionContract.java | 57 + .../models/PolicyDescriptions.java | 38 + .../models/PolicyExportFormat.java | 34 + .../apimanagement/models/PolicyIdName.java | 31 + .../models/PolicyScopeContract.java | 56 + .../models/PortalDelegationSettings.java | 67 + .../models/PortalRevisionCollection.java | 59 + .../models/PortalRevisionContract.java | 217 + .../models/PortalRevisionStatus.java | 40 + .../apimanagement/models/PortalRevisions.java | 134 + .../PortalRevisionsCreateOrUpdateHeaders.java | 50 + ...PortalRevisionsCreateOrUpdateResponse.java | 38 + .../PortalRevisionsGetEntityTagHeaders.java | 50 + .../PortalRevisionsGetEntityTagResponse.java | 30 + .../models/PortalRevisionsGetHeaders.java | 50 + .../models/PortalRevisionsGetResponse.java | 38 + .../models/PortalRevisionsUpdateHeaders.java | 50 + .../models/PortalRevisionsUpdateResponse.java | 38 + .../PortalSettingValidationKeyContract.java | 25 + .../apimanagement/models/PortalSettings.java | 37 + .../models/PortalSettingsCollection.java | 32 + .../models/PortalSettingsContract.java | 195 + .../models/PortalSigninSettings.java | 45 + .../models/PortalSignupSettings.java | 52 + .../apimanagement/models/ProductApis.java | 149 + .../models/ProductCollection.java | 107 + .../apimanagement/models/ProductContract.java | 417 ++ .../models/ProductContractProperties.java | 100 + .../models/ProductEntityBaseParameters.java | 222 + .../apimanagement/models/ProductGroups.java | 140 + .../apimanagement/models/ProductPolicies.java | 187 + .../ProductPoliciesCreateOrUpdateHeaders.java | 50 + ...ProductPoliciesCreateOrUpdateResponse.java | 38 + .../ProductPoliciesGetEntityTagHeaders.java | 50 + .../ProductPoliciesGetEntityTagResponse.java | 30 + .../models/ProductPoliciesGetHeaders.java | 50 + .../models/ProductPoliciesGetResponse.java | 37 + .../apimanagement/models/ProductState.java | 47 + .../models/ProductSubscriptions.java | 57 + .../ProductTagResourceContractProperties.java | 126 + .../models/ProductUpdateParameters.java | 250 + .../models/ProductUpdateProperties.java | 94 + .../apimanagement/models/Products.java | 247 + .../models/ProductsCreateOrUpdateHeaders.java | 50 + .../ProductsCreateOrUpdateResponse.java | 38 + .../models/ProductsGetEntityTagHeaders.java | 50 + .../models/ProductsGetEntityTagResponse.java | 26 + .../models/ProductsGetHeaders.java | 50 + .../models/ProductsGetResponse.java | 37 + .../models/ProductsUpdateHeaders.java | 50 + .../models/ProductsUpdateResponse.java | 37 + .../apimanagement/models/Protocol.java | 47 + .../models/ProvisioningState.java | 44 + .../models/QuotaByCounterKeys.java | 93 + .../models/QuotaByPeriodKeys.java | 100 + .../models/QuotaCounterCollection.java | 39 + .../models/QuotaCounterContract.java | 55 + .../QuotaCounterValueContractProperties.java | 76 + .../QuotaCounterValueUpdateContract.java | 78 + .../models/RecipientEmailCollection.java | 39 + .../models/RecipientEmailContract.java | 45 + .../models/RecipientUserCollection.java | 39 + .../models/RecipientUserContract.java | 45 + .../models/RecipientsContractProperties.java | 77 + .../apimanagement/models/RegionContract.java | 38 + .../models/RegionListResult.java | 107 + .../apimanagement/models/Regions.java | 36 + ...istrationDelegationSettingsProperties.java | 50 + .../models/ReportCollection.java | 107 + .../models/ReportRecordContract.java | 205 + .../apimanagement/models/Reports.java | 435 ++ .../models/RepresentationContract.java | 177 + .../apimanagement/models/RequestContract.java | 138 + .../models/RequestReportCollection.java | 81 + .../models/RequestReportRecordContract.java | 147 + .../models/ResourceLocationDataContract.java | 134 + .../apimanagement/models/ResourceSku.java | 50 + .../models/ResourceSkuCapacity.java | 84 + .../models/ResourceSkuCapacityScaleType.java | 37 + .../models/ResourceSkuResult.java | 38 + .../models/ResourceSkuResults.java | 85 + .../models/ResponseContract.java | 135 + .../models/SamplingSettings.java | 76 + .../apimanagement/models/SamplingType.java | 31 + .../models/SaveConfigurationParameter.java | 83 + .../models/SchemaCollection.java | 85 + .../apimanagement/models/SchemaContract.java | 269 + .../models/SettingsTypeName.java | 31 + .../apimanagement/models/SignInSettings.java | 130 + .../SignInSettingsGetEntityTagHeaders.java | 50 + .../SignInSettingsGetEntityTagResponse.java | 30 + .../models/SignInSettingsGetHeaders.java | 50 + .../models/SignInSettingsGetResponse.java | 37 + .../apimanagement/models/SignUpSettings.java | 130 + .../SignUpSettingsGetEntityTagHeaders.java | 50 + .../SignUpSettingsGetEntityTagResponse.java | 30 + .../models/SignUpSettingsGetHeaders.java | 50 + .../models/SignUpSettingsGetResponse.java | 37 + .../apimanagement/models/SkuType.java | 46 + .../apimanagement/models/SoapApiType.java | 34 + .../apimanagement/models/State.java | 43 + .../models/SubscriptionCollection.java | 107 + .../models/SubscriptionContract.java | 149 + .../models/SubscriptionCreateParameters.java | 233 + ...SubscriptionKeyParameterNamesContract.java | 76 + .../models/SubscriptionKeysContract.java | 31 + .../models/SubscriptionState.java | 59 + .../models/SubscriptionUpdateParameters.java | 289 + .../apimanagement/models/Subscriptions.java | 326 ++ .../SubscriptionsCreateOrUpdateHeaders.java | 50 + .../SubscriptionsCreateOrUpdateResponse.java | 38 + ...criptionsDelegationSettingsProperties.java | 50 + .../SubscriptionsGetEntityTagHeaders.java | 50 + .../SubscriptionsGetEntityTagResponse.java | 30 + .../models/SubscriptionsGetHeaders.java | 50 + .../models/SubscriptionsGetResponse.java | 37 + .../SubscriptionsListSecretsHeaders.java | 50 + .../SubscriptionsListSecretsResponse.java | 38 + .../models/SubscriptionsUpdateHeaders.java | 50 + .../models/SubscriptionsUpdateResponse.java | 38 + .../apimanagement/models/TagCollection.java | 107 + .../apimanagement/models/TagContract.java | 173 + .../models/TagCreateUpdateParameters.java | 52 + .../models/TagDescriptionBaseProperties.java | 102 + .../models/TagDescriptionCollection.java | 107 + .../models/TagDescriptionContract.java | 253 + .../TagDescriptionContractProperties.java | 99 + .../TagDescriptionCreateParameters.java | 104 + .../models/TagResourceCollection.java | 107 + .../models/TagResourceContract.java | 45 + .../models/TagResourceContractProperties.java | 76 + .../apimanagement/models/TagResources.java | 53 + .../apimanagement/models/Tags.java | 711 +++ .../models/TagsAssignToApiHeaders.java | 50 + .../models/TagsAssignToApiResponse.java | 37 + .../models/TagsCreateOrUpdateHeaders.java | 50 + .../models/TagsCreateOrUpdateResponse.java | 37 + .../models/TagsGetByApiHeaders.java | 50 + .../models/TagsGetByApiResponse.java | 37 + .../models/TagsGetByOperationHeaders.java | 50 + .../models/TagsGetByOperationResponse.java | 37 + .../models/TagsGetByProductHeaders.java | 50 + .../models/TagsGetByProductResponse.java | 37 + .../TagsGetEntityStateByApiHeaders.java | 50 + .../TagsGetEntityStateByApiResponse.java | 30 + .../TagsGetEntityStateByOperationHeaders.java | 50 + ...TagsGetEntityStateByOperationResponse.java | 31 + .../TagsGetEntityStateByProductHeaders.java | 50 + .../TagsGetEntityStateByProductResponse.java | 30 + .../models/TagsGetEntityStateHeaders.java | 50 + .../models/TagsGetEntityStateResponse.java | 26 + .../apimanagement/models/TagsGetHeaders.java | 50 + .../apimanagement/models/TagsGetResponse.java | 33 + .../models/TagsUpdateHeaders.java | 50 + .../models/TagsUpdateResponse.java | 37 + .../apimanagement/models/TemplateName.java | 76 + .../apimanagement/models/TenantAccess.java | 207 + .../models/TenantAccessCreateHeaders.java | 50 + .../models/TenantAccessCreateResponse.java | 38 + .../TenantAccessGetEntityTagHeaders.java | 50 + .../TenantAccessGetEntityTagResponse.java | 30 + .../models/TenantAccessGetHeaders.java | 50 + .../models/TenantAccessGetResponse.java | 38 + .../models/TenantAccessGits.java | 65 + .../TenantAccessListSecretsHeaders.java | 50 + .../TenantAccessListSecretsResponse.java | 38 + .../models/TenantAccessUpdateHeaders.java | 50 + .../models/TenantAccessUpdateResponse.java | 38 + .../TenantConfigurationSyncStateContract.java | 70 + .../models/TenantConfigurations.java | 160 + .../apimanagement/models/TenantSettings.java | 67 + .../models/TenantSettingsCollection.java | 59 + .../models/TenantSettingsContract.java | 46 + .../models/TenantSettingsGetHeaders.java | 50 + .../models/TenantSettingsGetResponse.java | 38 + .../models/TermsOfServiceProperties.java | 102 + .../models/TokenBodyParameterContract.java | 87 + .../apimanagement/models/UserCollection.java | 107 + .../models/UserConfirmationPasswords.java | 40 + .../apimanagement/models/UserContract.java | 455 ++ .../models/UserContractProperties.java | 176 + .../models/UserCreateParameterProperties.java | 230 + .../models/UserCreateParameters.java | 276 + .../models/UserEntityBaseParameters.java | 111 + .../apimanagement/models/UserGroups.java | 52 + .../apimanagement/models/UserIdentities.java | 39 + .../models/UserIdentityCollection.java | 107 + .../models/UserIdentityContract.java | 31 + .../models/UserIdentityProperties.java | 76 + .../apimanagement/models/UserState.java | 40 + .../models/UserSubscriptions.java | 89 + .../models/UserSubscriptionsGetHeaders.java | 50 + .../models/UserSubscriptionsGetResponse.java | 38 + .../models/UserTokenParameters.java | 84 + .../apimanagement/models/UserTokenResult.java | 24 + .../models/UserUpdateParameters.java | 218 + .../UserUpdateParametersProperties.java | 154 + .../apimanagement/models/Users.java | 273 + .../models/UsersCreateOrUpdateHeaders.java | 50 + .../models/UsersCreateOrUpdateResponse.java | 37 + .../models/UsersGetEntityTagHeaders.java | 50 + .../models/UsersGetEntityTagResponse.java | 26 + .../apimanagement/models/UsersGetHeaders.java | 50 + .../models/UsersGetResponse.java | 33 + .../models/UsersUpdateHeaders.java | 50 + .../models/UsersUpdateResponse.java | 37 + .../apimanagement/models/Verbosity.java | 37 + .../models/VersioningScheme.java | 37 + .../models/VirtualNetworkConfiguration.java | 84 + .../models/VirtualNetworkType.java | 37 + .../models/X509CertificateName.java | 76 + .../apimanagement/models/package-info.java | 6 + .../apimanagement/package-info.java | 6 + .../src/main/java/module-info.java | 19 + 1079 files changed, 203157 insertions(+) create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/CHANGELOG.md create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/README.md create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/ApiManagementManager.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiDiagnosticsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiExportsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueAttachmentsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueCommentsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssuesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementOperationsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServiceSkusClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServicesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementSkusClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationPoliciesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiPoliciesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiProductsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiReleasesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiRevisionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiSchemasClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiTagDescriptionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiVersionSetsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApisClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/AuthorizationServersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/BackendsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CachesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CertificatesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentItemsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentTypesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DelegationSettingsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DeletedServicesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DiagnosticsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/EmailTemplatesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayApisClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayCertificateAuthoritiesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayHostnameConfigurationsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewaysClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupUsersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IdentityProvidersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IssuesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/LoggersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NamedValuesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NetworkStatusClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientEmailsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientUsersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OpenIdConnectProvidersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OperationsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PoliciesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PolicyDescriptionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalRevisionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalSettingsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductApisClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductGroupsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductPoliciesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductSubscriptionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByCounterKeysClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByPeriodKeysClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/RegionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ReportsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignInSettingsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignUpSettingsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SubscriptionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagResourcesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessGitsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantConfigurationsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantSettingsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserConfirmationPasswordsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserGroupsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserIdentitiesClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserSubscriptionsClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UsersClient.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationSecretsContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiExportResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetDomainOwnershipIdentifierResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetSsoTokenResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceNameAvailabilityResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceResourceInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementSkuInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiReleaseContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiRevisionContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiVersionSetContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerSecretsContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/BackendContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CacheContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CertificateContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ClientSecretContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentItemContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentTypeContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DeletedServiceContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DiagnosticContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/EmailTemplateContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayCertificateAuthorityContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayHostnameConfigurationContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayKeysContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayTokenContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GenerateSsoUrlResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GroupContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IdentityProviderContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueAttachmentContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueCommentContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/LoggerContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueSecretContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractByLocationInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NotificationContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OpenidConnectProviderContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationResultContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyCollectionInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyDescriptionCollectionInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalDelegationSettingsInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalRevisionContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingValidationKeyContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingsCollectionInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSigninSettingsInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSignupSettingsInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ProductContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterCollectionInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailCollectionInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserCollectionInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RegionContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ReportRecordContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RequestReportRecordContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ResourceSkuResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SchemaContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionKeysContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagDescriptionContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagResourceContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantConfigurationSyncStateContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantSettingsContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserIdentityContractInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserTokenResultInner.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/package-info.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/package-info.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationSecretsContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientBuilder.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetDomainOwnershipIdentifierResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetSsoTokenResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceNameAvailabilityResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceResourceImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkuImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleaseContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerSecretsContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CacheContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificateContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ClientSecretContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypeContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServiceContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplateContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthorityContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayKeysContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayTokenContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GenerateSsoUrlResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProviderContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueAttachmentContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueCommentContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggerContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueSecretContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractByLocationImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenidConnectProviderContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationResultContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyCollectionImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionCollectionImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalDelegationSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingValidationKeyContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsCollectionImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSigninSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSignupSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterCollectionImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailCollectionImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserCollectionImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportRecordContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RequestReportRecordContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ResourceSkuResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SchemaContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionKeysContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagDescriptionContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourceContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationSyncStateContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentityContractImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserTokenResultImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersClientImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersImpl.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/Utils.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/package-info.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessIdName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCreateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationSecretsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AdditionalLocation.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AlwaysLog.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractUpdateProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateParameter.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdatePropertiesWsdlSelector.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnostics.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiEntityBaseContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResultValue.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExports.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachments.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueComments.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssues.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementOperations.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceApplyNetworkConfigurationParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBackupRestoreParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBaseProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceCheckNameAvailabilityParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetDomainOwnershipIdentifierResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetSsoTokenResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceIdentity.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceListResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceNameAvailabilityResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceResource.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkuProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkus.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServices.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSku.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapabilities.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacity.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacityScaleType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCosts.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuLocationInfo.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionInfo.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsReasonCode.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuZoneDetails.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkus.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkusResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPolicies.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperations.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPolicies.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiProducts.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleases.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemas.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagResourceContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionConstraint.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetails.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetailsVersioningScheme.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetEntityBase.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParametersProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSets.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimIdentityType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimResource.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Apis.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AppType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AssociationContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AsyncOperationStatus.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthenticationSettingsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationMethod.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractBaseProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerSecretsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServers.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendAuthorizationHeaderCredentials.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendBaseParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCredentialsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProtocol.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProxyContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendReconnectContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendServiceFabricClusterProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendTlsProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameterProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Backends.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethod.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethods.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BodyDiagnosticSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Caches.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfiguration.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfigurationStoreName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCreateOrUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateInformation.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Certificates.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientAuthenticationMethod.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientSecretContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConfigurationIdName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Confirmation.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentFormat.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItems.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypes.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMasking.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingEntity.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingMode.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServiceContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServices.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServicesCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeployConfigurationParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Diagnostics.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateParametersContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplates.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorFieldContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorResponseBody.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportApi.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportFormat.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportResultFormat.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApis.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorities.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurations.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeyRegenerationRequestContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeysContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenRequestContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Gateways.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GenerateSsoUrlResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GrantType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCreateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUsers.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Groups.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameConfiguration.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpCorrelationProtocol.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpMessageDiagnostic.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderBaseParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderList.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractBaseProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Issues.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractCreateProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultLastAccessStatusContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Loggers.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NameAvailabilityReason.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueEntityBaseParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueSecretContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameterProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValues.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatus.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContractByLocation.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientEmails.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientUsers.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Notifications.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OAuth2AuthenticationSettingsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdAuthenticationSettingsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviderCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operation.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationDisplay.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationEntityBaseContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationListResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationNameFormat.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultLogItemContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationTagResourceContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operations.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ParameterContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PipelineDiagnosticSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Policies.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContentFormat.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyExportFormat.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyIdName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyScopeContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalDelegationSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionStatus.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingValidationKeyContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSigninSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSignupSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductApis.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductEntityBaseParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductGroups.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPolicies.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductState.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductSubscriptions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductTagResourceContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Products.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Protocol.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProvisioningState.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByCounterKeys.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByPeriodKeys.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueUpdateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientsContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionListResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Regions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegistrationDelegationSettingsProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportRecordContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Reports.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RepresentationContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportRecordContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceLocationDataContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSku.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacity.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacityScaleType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResults.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResponseContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SaveConfigurationParameter.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SettingsTypeName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SkuType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SoapApiType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/State.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCreateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeyParameterNamesContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeysContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionState.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Subscriptions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsDelegationSettingsProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCreateUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionBaseProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCreateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResources.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Tags.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TemplateName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccess.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGits.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurationSyncStateContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurations.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettings.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TermsOfServiceProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TokenBodyParameterContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserConfirmationPasswords.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContractProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameterProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserEntityBaseParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserGroups.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentities.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityCollection.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityContract.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserState.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptions.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenResult.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParameters.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParametersProperties.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Users.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateHeaders.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateResponse.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Verbosity.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VersioningScheme.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkConfiguration.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkType.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/X509CertificateName.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/package-info.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/package-info.java create mode 100644 sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/module-info.java diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/CHANGELOG.md b/sdk/apimanagement/azure-resourcemanager-apimanagement/CHANGELOG.md new file mode 100644 index 0000000000000..228123d32f5f5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-03-16) + +- Azure Resource Manager ApiManagement client library for Java. This package contains Microsoft Azure SDK for ApiManagement Management SDK. ApiManagement Client. Package tag package-2020-12. 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/apimanagement/azure-resourcemanager-apimanagement/README.md b/sdk/apimanagement/azure-resourcemanager-apimanagement/README.md new file mode 100644 index 0000000000000..4aa9a465048ad --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager ApiManagement client library for Java + +Azure Resource Manager ApiManagement client library for Java. + +This package contains Microsoft Azure SDK for ApiManagement Management SDK. ApiManagement Client. Package tag package-2020-12. 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-apimanagement;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-apimanagement + 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(); +ApiManagementManager manager = ApiManagementManager + .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/apimanagement/azure-resourcemanager-apimanagement/pom.xml b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml new file mode 100644 index 0000000000000..3c170b0a2aeee --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/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-apimanagement + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ApiManagement Management + This package contains Microsoft Azure SDK for ApiManagement Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. ApiManagement Client. Package tag package-2020-12. + 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.14.0 + + + com.azure + azure-core-management + 1.2.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/ApiManagementManager.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/ApiManagementManager.java new file mode 100644 index 0000000000000..f9bd45c8a6e78 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/ApiManagementManager.java @@ -0,0 +1,1074 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement; + +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.apimanagement.fluent.ApiManagementClient; +import com.azure.resourcemanager.apimanagement.implementation.ApiDiagnosticsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiExportsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiIssueAttachmentsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiIssueCommentsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiIssuesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiManagementClientBuilder; +import com.azure.resourcemanager.apimanagement.implementation.ApiManagementOperationsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiManagementServiceSkusImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiManagementServicesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiManagementSkusImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiOperationPoliciesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiOperationsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiPoliciesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiProductsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiReleasesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiRevisionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiSchemasImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiTagDescriptionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApiVersionSetsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ApisImpl; +import com.azure.resourcemanager.apimanagement.implementation.AuthorizationServersImpl; +import com.azure.resourcemanager.apimanagement.implementation.BackendsImpl; +import com.azure.resourcemanager.apimanagement.implementation.CachesImpl; +import com.azure.resourcemanager.apimanagement.implementation.CertificatesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ContentItemsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ContentTypesImpl; +import com.azure.resourcemanager.apimanagement.implementation.DelegationSettingsImpl; +import com.azure.resourcemanager.apimanagement.implementation.DeletedServicesImpl; +import com.azure.resourcemanager.apimanagement.implementation.DiagnosticsImpl; +import com.azure.resourcemanager.apimanagement.implementation.EmailTemplatesImpl; +import com.azure.resourcemanager.apimanagement.implementation.GatewayApisImpl; +import com.azure.resourcemanager.apimanagement.implementation.GatewayCertificateAuthoritiesImpl; +import com.azure.resourcemanager.apimanagement.implementation.GatewayHostnameConfigurationsImpl; +import com.azure.resourcemanager.apimanagement.implementation.GatewaysImpl; +import com.azure.resourcemanager.apimanagement.implementation.GroupUsersImpl; +import com.azure.resourcemanager.apimanagement.implementation.GroupsImpl; +import com.azure.resourcemanager.apimanagement.implementation.IdentityProvidersImpl; +import com.azure.resourcemanager.apimanagement.implementation.IssuesImpl; +import com.azure.resourcemanager.apimanagement.implementation.LoggersImpl; +import com.azure.resourcemanager.apimanagement.implementation.NamedValuesImpl; +import com.azure.resourcemanager.apimanagement.implementation.NetworkStatusImpl; +import com.azure.resourcemanager.apimanagement.implementation.NotificationRecipientEmailsImpl; +import com.azure.resourcemanager.apimanagement.implementation.NotificationRecipientUsersImpl; +import com.azure.resourcemanager.apimanagement.implementation.NotificationsImpl; +import com.azure.resourcemanager.apimanagement.implementation.OpenIdConnectProvidersImpl; +import com.azure.resourcemanager.apimanagement.implementation.OperationsImpl; +import com.azure.resourcemanager.apimanagement.implementation.PoliciesImpl; +import com.azure.resourcemanager.apimanagement.implementation.PolicyDescriptionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.PortalRevisionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.PortalSettingsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ProductApisImpl; +import com.azure.resourcemanager.apimanagement.implementation.ProductGroupsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ProductPoliciesImpl; +import com.azure.resourcemanager.apimanagement.implementation.ProductSubscriptionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ProductsImpl; +import com.azure.resourcemanager.apimanagement.implementation.QuotaByCounterKeysImpl; +import com.azure.resourcemanager.apimanagement.implementation.QuotaByPeriodKeysImpl; +import com.azure.resourcemanager.apimanagement.implementation.RegionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.ReportsImpl; +import com.azure.resourcemanager.apimanagement.implementation.SignInSettingsImpl; +import com.azure.resourcemanager.apimanagement.implementation.SignUpSettingsImpl; +import com.azure.resourcemanager.apimanagement.implementation.SubscriptionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.TagResourcesImpl; +import com.azure.resourcemanager.apimanagement.implementation.TagsImpl; +import com.azure.resourcemanager.apimanagement.implementation.TenantAccessGitsImpl; +import com.azure.resourcemanager.apimanagement.implementation.TenantAccessImpl; +import com.azure.resourcemanager.apimanagement.implementation.TenantConfigurationsImpl; +import com.azure.resourcemanager.apimanagement.implementation.TenantSettingsImpl; +import com.azure.resourcemanager.apimanagement.implementation.UserConfirmationPasswordsImpl; +import com.azure.resourcemanager.apimanagement.implementation.UserGroupsImpl; +import com.azure.resourcemanager.apimanagement.implementation.UserIdentitiesImpl; +import com.azure.resourcemanager.apimanagement.implementation.UserSubscriptionsImpl; +import com.azure.resourcemanager.apimanagement.implementation.UsersImpl; +import com.azure.resourcemanager.apimanagement.models.ApiDiagnostics; +import com.azure.resourcemanager.apimanagement.models.ApiExports; +import com.azure.resourcemanager.apimanagement.models.ApiIssueAttachments; +import com.azure.resourcemanager.apimanagement.models.ApiIssueComments; +import com.azure.resourcemanager.apimanagement.models.ApiIssues; +import com.azure.resourcemanager.apimanagement.models.ApiManagementOperations; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkus; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServices; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkus; +import com.azure.resourcemanager.apimanagement.models.ApiOperationPolicies; +import com.azure.resourcemanager.apimanagement.models.ApiOperations; +import com.azure.resourcemanager.apimanagement.models.ApiPolicies; +import com.azure.resourcemanager.apimanagement.models.ApiProducts; +import com.azure.resourcemanager.apimanagement.models.ApiReleases; +import com.azure.resourcemanager.apimanagement.models.ApiRevisions; +import com.azure.resourcemanager.apimanagement.models.ApiSchemas; +import com.azure.resourcemanager.apimanagement.models.ApiTagDescriptions; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSets; +import com.azure.resourcemanager.apimanagement.models.Apis; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServers; +import com.azure.resourcemanager.apimanagement.models.Backends; +import com.azure.resourcemanager.apimanagement.models.Caches; +import com.azure.resourcemanager.apimanagement.models.Certificates; +import com.azure.resourcemanager.apimanagement.models.ContentItems; +import com.azure.resourcemanager.apimanagement.models.ContentTypes; +import com.azure.resourcemanager.apimanagement.models.DelegationSettings; +import com.azure.resourcemanager.apimanagement.models.DeletedServices; +import com.azure.resourcemanager.apimanagement.models.Diagnostics; +import com.azure.resourcemanager.apimanagement.models.EmailTemplates; +import com.azure.resourcemanager.apimanagement.models.GatewayApis; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthorities; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurations; +import com.azure.resourcemanager.apimanagement.models.Gateways; +import com.azure.resourcemanager.apimanagement.models.GroupUsers; +import com.azure.resourcemanager.apimanagement.models.Groups; +import com.azure.resourcemanager.apimanagement.models.IdentityProviders; +import com.azure.resourcemanager.apimanagement.models.Issues; +import com.azure.resourcemanager.apimanagement.models.Loggers; +import com.azure.resourcemanager.apimanagement.models.NamedValues; +import com.azure.resourcemanager.apimanagement.models.NetworkStatus; +import com.azure.resourcemanager.apimanagement.models.NotificationRecipientEmails; +import com.azure.resourcemanager.apimanagement.models.NotificationRecipientUsers; +import com.azure.resourcemanager.apimanagement.models.Notifications; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProviders; +import com.azure.resourcemanager.apimanagement.models.Operations; +import com.azure.resourcemanager.apimanagement.models.Policies; +import com.azure.resourcemanager.apimanagement.models.PolicyDescriptions; +import com.azure.resourcemanager.apimanagement.models.PortalRevisions; +import com.azure.resourcemanager.apimanagement.models.PortalSettings; +import com.azure.resourcemanager.apimanagement.models.ProductApis; +import com.azure.resourcemanager.apimanagement.models.ProductGroups; +import com.azure.resourcemanager.apimanagement.models.ProductPolicies; +import com.azure.resourcemanager.apimanagement.models.ProductSubscriptions; +import com.azure.resourcemanager.apimanagement.models.Products; +import com.azure.resourcemanager.apimanagement.models.QuotaByCounterKeys; +import com.azure.resourcemanager.apimanagement.models.QuotaByPeriodKeys; +import com.azure.resourcemanager.apimanagement.models.Regions; +import com.azure.resourcemanager.apimanagement.models.Reports; +import com.azure.resourcemanager.apimanagement.models.SignInSettings; +import com.azure.resourcemanager.apimanagement.models.SignUpSettings; +import com.azure.resourcemanager.apimanagement.models.Subscriptions; +import com.azure.resourcemanager.apimanagement.models.TagResources; +import com.azure.resourcemanager.apimanagement.models.Tags; +import com.azure.resourcemanager.apimanagement.models.TenantAccess; +import com.azure.resourcemanager.apimanagement.models.TenantAccessGits; +import com.azure.resourcemanager.apimanagement.models.TenantConfigurations; +import com.azure.resourcemanager.apimanagement.models.TenantSettings; +import com.azure.resourcemanager.apimanagement.models.UserConfirmationPasswords; +import com.azure.resourcemanager.apimanagement.models.UserGroups; +import com.azure.resourcemanager.apimanagement.models.UserIdentities; +import com.azure.resourcemanager.apimanagement.models.UserSubscriptions; +import com.azure.resourcemanager.apimanagement.models.Users; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ApiManagementManager. ApiManagement Client. */ +public final class ApiManagementManager { + private Apis apis; + + private ApiRevisions apiRevisions; + + private ApiReleases apiReleases; + + private ApiOperations apiOperations; + + private ApiOperationPolicies apiOperationPolicies; + + private Tags tags; + + private ApiProducts apiProducts; + + private ApiPolicies apiPolicies; + + private ApiSchemas apiSchemas; + + private ApiDiagnostics apiDiagnostics; + + private ApiIssues apiIssues; + + private ApiIssueComments apiIssueComments; + + private ApiIssueAttachments apiIssueAttachments; + + private ApiTagDescriptions apiTagDescriptions; + + private Operations operations; + + private ApiExports apiExports; + + private ApiVersionSets apiVersionSets; + + private AuthorizationServers authorizationServers; + + private Backends backends; + + private Caches caches; + + private Certificates certificates; + + private ContentTypes contentTypes; + + private ContentItems contentItems; + + private DeletedServices deletedServices; + + private ApiManagementOperations apiManagementOperations; + + private ApiManagementServiceSkus apiManagementServiceSkus; + + private ApiManagementServices apiManagementServices; + + private Diagnostics diagnostics; + + private EmailTemplates emailTemplates; + + private Gateways gateways; + + private GatewayHostnameConfigurations gatewayHostnameConfigurations; + + private GatewayApis gatewayApis; + + private GatewayCertificateAuthorities gatewayCertificateAuthorities; + + private Groups groups; + + private GroupUsers groupUsers; + + private IdentityProviders identityProviders; + + private Issues issues; + + private Loggers loggers; + + private NamedValues namedValues; + + private NetworkStatus networkStatus; + + private Notifications notifications; + + private NotificationRecipientUsers notificationRecipientUsers; + + private NotificationRecipientEmails notificationRecipientEmails; + + private OpenIdConnectProviders openIdConnectProviders; + + private Policies policies; + + private PolicyDescriptions policyDescriptions; + + private PortalRevisions portalRevisions; + + private PortalSettings portalSettings; + + private SignInSettings signInSettings; + + private SignUpSettings signUpSettings; + + private DelegationSettings delegationSettings; + + private Products products; + + private ProductApis productApis; + + private ProductGroups productGroups; + + private ProductSubscriptions productSubscriptions; + + private ProductPolicies productPolicies; + + private QuotaByCounterKeys quotaByCounterKeys; + + private QuotaByPeriodKeys quotaByPeriodKeys; + + private Regions regions; + + private Reports reports; + + private TenantSettings tenantSettings; + + private ApiManagementSkus apiManagementSkus; + + private Subscriptions subscriptions; + + private TagResources tagResources; + + private TenantAccess tenantAccess; + + private TenantAccessGits tenantAccessGits; + + private TenantConfigurations tenantConfigurations; + + private Users users; + + private UserGroups userGroups; + + private UserSubscriptions userSubscriptions; + + private UserIdentities userIdentities; + + private UserConfirmationPasswords userConfirmationPasswords; + + private final ApiManagementClient clientObject; + + private ApiManagementManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ApiManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ApiManagement service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ApiManagement service API instance. + */ + public static ApiManagementManager 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 ApiManagementManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ApiManagementManager.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 ApiManagement service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ApiManagement service API instance. + */ + public ApiManagementManager 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.apimanagement") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ApiManagementManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Apis. */ + public Apis apis() { + if (this.apis == null) { + this.apis = new ApisImpl(clientObject.getApis(), this); + } + return apis; + } + + /** @return Resource collection API of ApiRevisions. */ + public ApiRevisions apiRevisions() { + if (this.apiRevisions == null) { + this.apiRevisions = new ApiRevisionsImpl(clientObject.getApiRevisions(), this); + } + return apiRevisions; + } + + /** @return Resource collection API of ApiReleases. */ + public ApiReleases apiReleases() { + if (this.apiReleases == null) { + this.apiReleases = new ApiReleasesImpl(clientObject.getApiReleases(), this); + } + return apiReleases; + } + + /** @return Resource collection API of ApiOperations. */ + public ApiOperations apiOperations() { + if (this.apiOperations == null) { + this.apiOperations = new ApiOperationsImpl(clientObject.getApiOperations(), this); + } + return apiOperations; + } + + /** @return Resource collection API of ApiOperationPolicies. */ + public ApiOperationPolicies apiOperationPolicies() { + if (this.apiOperationPolicies == null) { + this.apiOperationPolicies = new ApiOperationPoliciesImpl(clientObject.getApiOperationPolicies(), this); + } + return apiOperationPolicies; + } + + /** @return Resource collection API of Tags. */ + public Tags tags() { + if (this.tags == null) { + this.tags = new TagsImpl(clientObject.getTags(), this); + } + return tags; + } + + /** @return Resource collection API of ApiProducts. */ + public ApiProducts apiProducts() { + if (this.apiProducts == null) { + this.apiProducts = new ApiProductsImpl(clientObject.getApiProducts(), this); + } + return apiProducts; + } + + /** @return Resource collection API of ApiPolicies. */ + public ApiPolicies apiPolicies() { + if (this.apiPolicies == null) { + this.apiPolicies = new ApiPoliciesImpl(clientObject.getApiPolicies(), this); + } + return apiPolicies; + } + + /** @return Resource collection API of ApiSchemas. */ + public ApiSchemas apiSchemas() { + if (this.apiSchemas == null) { + this.apiSchemas = new ApiSchemasImpl(clientObject.getApiSchemas(), this); + } + return apiSchemas; + } + + /** @return Resource collection API of ApiDiagnostics. */ + public ApiDiagnostics apiDiagnostics() { + if (this.apiDiagnostics == null) { + this.apiDiagnostics = new ApiDiagnosticsImpl(clientObject.getApiDiagnostics(), this); + } + return apiDiagnostics; + } + + /** @return Resource collection API of ApiIssues. */ + public ApiIssues apiIssues() { + if (this.apiIssues == null) { + this.apiIssues = new ApiIssuesImpl(clientObject.getApiIssues(), this); + } + return apiIssues; + } + + /** @return Resource collection API of ApiIssueComments. */ + public ApiIssueComments apiIssueComments() { + if (this.apiIssueComments == null) { + this.apiIssueComments = new ApiIssueCommentsImpl(clientObject.getApiIssueComments(), this); + } + return apiIssueComments; + } + + /** @return Resource collection API of ApiIssueAttachments. */ + public ApiIssueAttachments apiIssueAttachments() { + if (this.apiIssueAttachments == null) { + this.apiIssueAttachments = new ApiIssueAttachmentsImpl(clientObject.getApiIssueAttachments(), this); + } + return apiIssueAttachments; + } + + /** @return Resource collection API of ApiTagDescriptions. */ + public ApiTagDescriptions apiTagDescriptions() { + if (this.apiTagDescriptions == null) { + this.apiTagDescriptions = new ApiTagDescriptionsImpl(clientObject.getApiTagDescriptions(), this); + } + return apiTagDescriptions; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of ApiExports. */ + public ApiExports apiExports() { + if (this.apiExports == null) { + this.apiExports = new ApiExportsImpl(clientObject.getApiExports(), this); + } + return apiExports; + } + + /** @return Resource collection API of ApiVersionSets. */ + public ApiVersionSets apiVersionSets() { + if (this.apiVersionSets == null) { + this.apiVersionSets = new ApiVersionSetsImpl(clientObject.getApiVersionSets(), this); + } + return apiVersionSets; + } + + /** @return Resource collection API of AuthorizationServers. */ + public AuthorizationServers authorizationServers() { + if (this.authorizationServers == null) { + this.authorizationServers = new AuthorizationServersImpl(clientObject.getAuthorizationServers(), this); + } + return authorizationServers; + } + + /** @return Resource collection API of Backends. */ + public Backends backends() { + if (this.backends == null) { + this.backends = new BackendsImpl(clientObject.getBackends(), this); + } + return backends; + } + + /** @return Resource collection API of Caches. */ + public Caches caches() { + if (this.caches == null) { + this.caches = new CachesImpl(clientObject.getCaches(), this); + } + return caches; + } + + /** @return Resource collection API of Certificates. */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); + } + return certificates; + } + + /** @return Resource collection API of ContentTypes. */ + public ContentTypes contentTypes() { + if (this.contentTypes == null) { + this.contentTypes = new ContentTypesImpl(clientObject.getContentTypes(), this); + } + return contentTypes; + } + + /** @return Resource collection API of ContentItems. */ + public ContentItems contentItems() { + if (this.contentItems == null) { + this.contentItems = new ContentItemsImpl(clientObject.getContentItems(), this); + } + return contentItems; + } + + /** @return Resource collection API of DeletedServices. */ + public DeletedServices deletedServices() { + if (this.deletedServices == null) { + this.deletedServices = new DeletedServicesImpl(clientObject.getDeletedServices(), this); + } + return deletedServices; + } + + /** @return Resource collection API of ApiManagementOperations. */ + public ApiManagementOperations apiManagementOperations() { + if (this.apiManagementOperations == null) { + this.apiManagementOperations = + new ApiManagementOperationsImpl(clientObject.getApiManagementOperations(), this); + } + return apiManagementOperations; + } + + /** @return Resource collection API of ApiManagementServiceSkus. */ + public ApiManagementServiceSkus apiManagementServiceSkus() { + if (this.apiManagementServiceSkus == null) { + this.apiManagementServiceSkus = + new ApiManagementServiceSkusImpl(clientObject.getApiManagementServiceSkus(), this); + } + return apiManagementServiceSkus; + } + + /** @return Resource collection API of ApiManagementServices. */ + public ApiManagementServices apiManagementServices() { + if (this.apiManagementServices == null) { + this.apiManagementServices = new ApiManagementServicesImpl(clientObject.getApiManagementServices(), this); + } + return apiManagementServices; + } + + /** @return Resource collection API of Diagnostics. */ + public Diagnostics diagnostics() { + if (this.diagnostics == null) { + this.diagnostics = new DiagnosticsImpl(clientObject.getDiagnostics(), this); + } + return diagnostics; + } + + /** @return Resource collection API of EmailTemplates. */ + public EmailTemplates emailTemplates() { + if (this.emailTemplates == null) { + this.emailTemplates = new EmailTemplatesImpl(clientObject.getEmailTemplates(), this); + } + return emailTemplates; + } + + /** @return Resource collection API of Gateways. */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + + /** @return Resource collection API of GatewayHostnameConfigurations. */ + public GatewayHostnameConfigurations gatewayHostnameConfigurations() { + if (this.gatewayHostnameConfigurations == null) { + this.gatewayHostnameConfigurations = + new GatewayHostnameConfigurationsImpl(clientObject.getGatewayHostnameConfigurations(), this); + } + return gatewayHostnameConfigurations; + } + + /** @return Resource collection API of GatewayApis. */ + public GatewayApis gatewayApis() { + if (this.gatewayApis == null) { + this.gatewayApis = new GatewayApisImpl(clientObject.getGatewayApis(), this); + } + return gatewayApis; + } + + /** @return Resource collection API of GatewayCertificateAuthorities. */ + public GatewayCertificateAuthorities gatewayCertificateAuthorities() { + if (this.gatewayCertificateAuthorities == null) { + this.gatewayCertificateAuthorities = + new GatewayCertificateAuthoritiesImpl(clientObject.getGatewayCertificateAuthorities(), this); + } + return gatewayCertificateAuthorities; + } + + /** @return Resource collection API of Groups. */ + public Groups groups() { + if (this.groups == null) { + this.groups = new GroupsImpl(clientObject.getGroups(), this); + } + return groups; + } + + /** @return Resource collection API of GroupUsers. */ + public GroupUsers groupUsers() { + if (this.groupUsers == null) { + this.groupUsers = new GroupUsersImpl(clientObject.getGroupUsers(), this); + } + return groupUsers; + } + + /** @return Resource collection API of IdentityProviders. */ + public IdentityProviders identityProviders() { + if (this.identityProviders == null) { + this.identityProviders = new IdentityProvidersImpl(clientObject.getIdentityProviders(), this); + } + return identityProviders; + } + + /** @return Resource collection API of Issues. */ + public Issues issues() { + if (this.issues == null) { + this.issues = new IssuesImpl(clientObject.getIssues(), this); + } + return issues; + } + + /** @return Resource collection API of Loggers. */ + public Loggers loggers() { + if (this.loggers == null) { + this.loggers = new LoggersImpl(clientObject.getLoggers(), this); + } + return loggers; + } + + /** @return Resource collection API of NamedValues. */ + public NamedValues namedValues() { + if (this.namedValues == null) { + this.namedValues = new NamedValuesImpl(clientObject.getNamedValues(), this); + } + return namedValues; + } + + /** @return Resource collection API of NetworkStatus. */ + public NetworkStatus networkStatus() { + if (this.networkStatus == null) { + this.networkStatus = new NetworkStatusImpl(clientObject.getNetworkStatus(), this); + } + return networkStatus; + } + + /** @return Resource collection API of Notifications. */ + public Notifications notifications() { + if (this.notifications == null) { + this.notifications = new NotificationsImpl(clientObject.getNotifications(), this); + } + return notifications; + } + + /** @return Resource collection API of NotificationRecipientUsers. */ + public NotificationRecipientUsers notificationRecipientUsers() { + if (this.notificationRecipientUsers == null) { + this.notificationRecipientUsers = + new NotificationRecipientUsersImpl(clientObject.getNotificationRecipientUsers(), this); + } + return notificationRecipientUsers; + } + + /** @return Resource collection API of NotificationRecipientEmails. */ + public NotificationRecipientEmails notificationRecipientEmails() { + if (this.notificationRecipientEmails == null) { + this.notificationRecipientEmails = + new NotificationRecipientEmailsImpl(clientObject.getNotificationRecipientEmails(), this); + } + return notificationRecipientEmails; + } + + /** @return Resource collection API of OpenIdConnectProviders. */ + public OpenIdConnectProviders openIdConnectProviders() { + if (this.openIdConnectProviders == null) { + this.openIdConnectProviders = + new OpenIdConnectProvidersImpl(clientObject.getOpenIdConnectProviders(), this); + } + return openIdConnectProviders; + } + + /** @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 PolicyDescriptions. */ + public PolicyDescriptions policyDescriptions() { + if (this.policyDescriptions == null) { + this.policyDescriptions = new PolicyDescriptionsImpl(clientObject.getPolicyDescriptions(), this); + } + return policyDescriptions; + } + + /** @return Resource collection API of PortalRevisions. */ + public PortalRevisions portalRevisions() { + if (this.portalRevisions == null) { + this.portalRevisions = new PortalRevisionsImpl(clientObject.getPortalRevisions(), this); + } + return portalRevisions; + } + + /** @return Resource collection API of PortalSettings. */ + public PortalSettings portalSettings() { + if (this.portalSettings == null) { + this.portalSettings = new PortalSettingsImpl(clientObject.getPortalSettings(), this); + } + return portalSettings; + } + + /** @return Resource collection API of SignInSettings. */ + public SignInSettings signInSettings() { + if (this.signInSettings == null) { + this.signInSettings = new SignInSettingsImpl(clientObject.getSignInSettings(), this); + } + return signInSettings; + } + + /** @return Resource collection API of SignUpSettings. */ + public SignUpSettings signUpSettings() { + if (this.signUpSettings == null) { + this.signUpSettings = new SignUpSettingsImpl(clientObject.getSignUpSettings(), this); + } + return signUpSettings; + } + + /** @return Resource collection API of DelegationSettings. */ + public DelegationSettings delegationSettings() { + if (this.delegationSettings == null) { + this.delegationSettings = new DelegationSettingsImpl(clientObject.getDelegationSettings(), this); + } + return delegationSettings; + } + + /** @return Resource collection API of Products. */ + public Products products() { + if (this.products == null) { + this.products = new ProductsImpl(clientObject.getProducts(), this); + } + return products; + } + + /** @return Resource collection API of ProductApis. */ + public ProductApis productApis() { + if (this.productApis == null) { + this.productApis = new ProductApisImpl(clientObject.getProductApis(), this); + } + return productApis; + } + + /** @return Resource collection API of ProductGroups. */ + public ProductGroups productGroups() { + if (this.productGroups == null) { + this.productGroups = new ProductGroupsImpl(clientObject.getProductGroups(), this); + } + return productGroups; + } + + /** @return Resource collection API of ProductSubscriptions. */ + public ProductSubscriptions productSubscriptions() { + if (this.productSubscriptions == null) { + this.productSubscriptions = new ProductSubscriptionsImpl(clientObject.getProductSubscriptions(), this); + } + return productSubscriptions; + } + + /** @return Resource collection API of ProductPolicies. */ + public ProductPolicies productPolicies() { + if (this.productPolicies == null) { + this.productPolicies = new ProductPoliciesImpl(clientObject.getProductPolicies(), this); + } + return productPolicies; + } + + /** @return Resource collection API of QuotaByCounterKeys. */ + public QuotaByCounterKeys quotaByCounterKeys() { + if (this.quotaByCounterKeys == null) { + this.quotaByCounterKeys = new QuotaByCounterKeysImpl(clientObject.getQuotaByCounterKeys(), this); + } + return quotaByCounterKeys; + } + + /** @return Resource collection API of QuotaByPeriodKeys. */ + public QuotaByPeriodKeys quotaByPeriodKeys() { + if (this.quotaByPeriodKeys == null) { + this.quotaByPeriodKeys = new QuotaByPeriodKeysImpl(clientObject.getQuotaByPeriodKeys(), this); + } + return quotaByPeriodKeys; + } + + /** @return Resource collection API of Regions. */ + public Regions regions() { + if (this.regions == null) { + this.regions = new RegionsImpl(clientObject.getRegions(), this); + } + return regions; + } + + /** @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 TenantSettings. */ + public TenantSettings tenantSettings() { + if (this.tenantSettings == null) { + this.tenantSettings = new TenantSettingsImpl(clientObject.getTenantSettings(), this); + } + return tenantSettings; + } + + /** @return Resource collection API of ApiManagementSkus. */ + public ApiManagementSkus apiManagementSkus() { + if (this.apiManagementSkus == null) { + this.apiManagementSkus = new ApiManagementSkusImpl(clientObject.getApiManagementSkus(), this); + } + return apiManagementSkus; + } + + /** @return Resource collection API of Subscriptions. */ + public Subscriptions subscriptions() { + if (this.subscriptions == null) { + this.subscriptions = new SubscriptionsImpl(clientObject.getSubscriptions(), this); + } + return subscriptions; + } + + /** @return Resource collection API of TagResources. */ + public TagResources tagResources() { + if (this.tagResources == null) { + this.tagResources = new TagResourcesImpl(clientObject.getTagResources(), this); + } + return tagResources; + } + + /** @return Resource collection API of TenantAccess. */ + public TenantAccess tenantAccess() { + if (this.tenantAccess == null) { + this.tenantAccess = new TenantAccessImpl(clientObject.getTenantAccess(), this); + } + return tenantAccess; + } + + /** @return Resource collection API of TenantAccessGits. */ + public TenantAccessGits tenantAccessGits() { + if (this.tenantAccessGits == null) { + this.tenantAccessGits = new TenantAccessGitsImpl(clientObject.getTenantAccessGits(), this); + } + return tenantAccessGits; + } + + /** @return Resource collection API of TenantConfigurations. */ + public TenantConfigurations tenantConfigurations() { + if (this.tenantConfigurations == null) { + this.tenantConfigurations = new TenantConfigurationsImpl(clientObject.getTenantConfigurations(), this); + } + return tenantConfigurations; + } + + /** @return Resource collection API of Users. */ + public Users users() { + if (this.users == null) { + this.users = new UsersImpl(clientObject.getUsers(), this); + } + return users; + } + + /** @return Resource collection API of UserGroups. */ + public UserGroups userGroups() { + if (this.userGroups == null) { + this.userGroups = new UserGroupsImpl(clientObject.getUserGroups(), this); + } + return userGroups; + } + + /** @return Resource collection API of UserSubscriptions. */ + public UserSubscriptions userSubscriptions() { + if (this.userSubscriptions == null) { + this.userSubscriptions = new UserSubscriptionsImpl(clientObject.getUserSubscriptions(), this); + } + return userSubscriptions; + } + + /** @return Resource collection API of UserIdentities. */ + public UserIdentities userIdentities() { + if (this.userIdentities == null) { + this.userIdentities = new UserIdentitiesImpl(clientObject.getUserIdentities(), this); + } + return userIdentities; + } + + /** @return Resource collection API of UserConfirmationPasswords. */ + public UserConfirmationPasswords userConfirmationPasswords() { + if (this.userConfirmationPasswords == null) { + this.userConfirmationPasswords = + new UserConfirmationPasswordsImpl(clientObject.getUserConfirmationPasswords(), this); + } + return userConfirmationPasswords; + } + + /** + * @return Wrapped service client ApiManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public ApiManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiDiagnosticsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiDiagnosticsClient.java new file mode 100644 index 0000000000000..99599f34847cb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiDiagnosticsClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** An instance of this class provides access to all the operations defined in ApiDiagnosticsClient. */ +public interface ApiDiagnosticsClient { + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String diagnosticId); + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context); + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticContractInner get(String resourceGroupName, String serviceName, String apiId, String diagnosticId); + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context); + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters); + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters); + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters, + Context context); + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String diagnosticId, String ifMatch); + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiExportsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiExportsClient.java new file mode 100644 index 0000000000000..bbed9edac62d5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiExportsClient.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.apimanagement.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.apimanagement.fluent.models.ApiExportResultInner; +import com.azure.resourcemanager.apimanagement.models.ExportApi; +import com.azure.resourcemanager.apimanagement.models.ExportFormat; + +/** An instance of this class provides access to all the operations defined in ApiExportsClient. */ +public interface ApiExportsClient { + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiExportResultInner get( + String resourceGroupName, String serviceName, String apiId, ExportFormat format, ExportApi export); + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + ExportFormat format, + ExportApi export, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueAttachmentsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueAttachmentsClient.java new file mode 100644 index 0000000000000..df8051b825674 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueAttachmentsClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; + +/** An instance of this class provides access to all the operations defined in ApiIssueAttachmentsClient. */ +public interface ApiIssueAttachmentsClient { + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId); + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context); + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueAttachmentContractInner get( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId); + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context); + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueAttachmentContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters); + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueCommentsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueCommentsClient.java new file mode 100644 index 0000000000000..5a9670efdbd55 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssueCommentsClient.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; + +/** An instance of this class provides access to all the operations defined in ApiIssueCommentsClient. */ +public interface ApiIssueCommentsClient { + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId, String commentId); + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context); + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueCommentContractInner get( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId); + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context); + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueCommentContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters); + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String issueId, String commentId, String ifMatch); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssuesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssuesClient.java new file mode 100644 index 0000000000000..2ff4cd27af6c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiIssuesClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.azure.resourcemanager.apimanagement.models.IssueUpdateContract; + +/** An instance of this class provides access to all the operations defined in ApiIssuesClient. */ +public interface ApiIssuesClient { + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, Context context); + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueContractInner get(String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param expandCommentsAttachments Expand the comment attachments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + Boolean expandCommentsAttachments, + Context context); + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueContractInner createOrUpdate( + String resourceGroupName, String serviceName, String apiId, String issueId, IssueContractInner parameters); + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + IssueContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract parameters); + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract parameters, + Context context); + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String issueId, String ifMatch); + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementClient.java new file mode 100644 index 0000000000000..bff1e037aa51a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementClient.java @@ -0,0 +1,551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ApiManagementClient class. */ +public interface ApiManagementClient { + /** + * Gets Subscription credentials which uniquely identify 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 Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ApisClient object to access its operations. + * + * @return the ApisClient object. + */ + ApisClient getApis(); + + /** + * Gets the ApiRevisionsClient object to access its operations. + * + * @return the ApiRevisionsClient object. + */ + ApiRevisionsClient getApiRevisions(); + + /** + * Gets the ApiReleasesClient object to access its operations. + * + * @return the ApiReleasesClient object. + */ + ApiReleasesClient getApiReleases(); + + /** + * Gets the ApiOperationsClient object to access its operations. + * + * @return the ApiOperationsClient object. + */ + ApiOperationsClient getApiOperations(); + + /** + * Gets the ApiOperationPoliciesClient object to access its operations. + * + * @return the ApiOperationPoliciesClient object. + */ + ApiOperationPoliciesClient getApiOperationPolicies(); + + /** + * Gets the TagsClient object to access its operations. + * + * @return the TagsClient object. + */ + TagsClient getTags(); + + /** + * Gets the ApiProductsClient object to access its operations. + * + * @return the ApiProductsClient object. + */ + ApiProductsClient getApiProducts(); + + /** + * Gets the ApiPoliciesClient object to access its operations. + * + * @return the ApiPoliciesClient object. + */ + ApiPoliciesClient getApiPolicies(); + + /** + * Gets the ApiSchemasClient object to access its operations. + * + * @return the ApiSchemasClient object. + */ + ApiSchemasClient getApiSchemas(); + + /** + * Gets the ApiDiagnosticsClient object to access its operations. + * + * @return the ApiDiagnosticsClient object. + */ + ApiDiagnosticsClient getApiDiagnostics(); + + /** + * Gets the ApiIssuesClient object to access its operations. + * + * @return the ApiIssuesClient object. + */ + ApiIssuesClient getApiIssues(); + + /** + * Gets the ApiIssueCommentsClient object to access its operations. + * + * @return the ApiIssueCommentsClient object. + */ + ApiIssueCommentsClient getApiIssueComments(); + + /** + * Gets the ApiIssueAttachmentsClient object to access its operations. + * + * @return the ApiIssueAttachmentsClient object. + */ + ApiIssueAttachmentsClient getApiIssueAttachments(); + + /** + * Gets the ApiTagDescriptionsClient object to access its operations. + * + * @return the ApiTagDescriptionsClient object. + */ + ApiTagDescriptionsClient getApiTagDescriptions(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ApiExportsClient object to access its operations. + * + * @return the ApiExportsClient object. + */ + ApiExportsClient getApiExports(); + + /** + * Gets the ApiVersionSetsClient object to access its operations. + * + * @return the ApiVersionSetsClient object. + */ + ApiVersionSetsClient getApiVersionSets(); + + /** + * Gets the AuthorizationServersClient object to access its operations. + * + * @return the AuthorizationServersClient object. + */ + AuthorizationServersClient getAuthorizationServers(); + + /** + * Gets the BackendsClient object to access its operations. + * + * @return the BackendsClient object. + */ + BackendsClient getBackends(); + + /** + * Gets the CachesClient object to access its operations. + * + * @return the CachesClient object. + */ + CachesClient getCaches(); + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + CertificatesClient getCertificates(); + + /** + * Gets the ContentTypesClient object to access its operations. + * + * @return the ContentTypesClient object. + */ + ContentTypesClient getContentTypes(); + + /** + * Gets the ContentItemsClient object to access its operations. + * + * @return the ContentItemsClient object. + */ + ContentItemsClient getContentItems(); + + /** + * Gets the DeletedServicesClient object to access its operations. + * + * @return the DeletedServicesClient object. + */ + DeletedServicesClient getDeletedServices(); + + /** + * Gets the ApiManagementOperationsClient object to access its operations. + * + * @return the ApiManagementOperationsClient object. + */ + ApiManagementOperationsClient getApiManagementOperations(); + + /** + * Gets the ApiManagementServiceSkusClient object to access its operations. + * + * @return the ApiManagementServiceSkusClient object. + */ + ApiManagementServiceSkusClient getApiManagementServiceSkus(); + + /** + * Gets the ApiManagementServicesClient object to access its operations. + * + * @return the ApiManagementServicesClient object. + */ + ApiManagementServicesClient getApiManagementServices(); + + /** + * Gets the DiagnosticsClient object to access its operations. + * + * @return the DiagnosticsClient object. + */ + DiagnosticsClient getDiagnostics(); + + /** + * Gets the EmailTemplatesClient object to access its operations. + * + * @return the EmailTemplatesClient object. + */ + EmailTemplatesClient getEmailTemplates(); + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + GatewaysClient getGateways(); + + /** + * Gets the GatewayHostnameConfigurationsClient object to access its operations. + * + * @return the GatewayHostnameConfigurationsClient object. + */ + GatewayHostnameConfigurationsClient getGatewayHostnameConfigurations(); + + /** + * Gets the GatewayApisClient object to access its operations. + * + * @return the GatewayApisClient object. + */ + GatewayApisClient getGatewayApis(); + + /** + * Gets the GatewayCertificateAuthoritiesClient object to access its operations. + * + * @return the GatewayCertificateAuthoritiesClient object. + */ + GatewayCertificateAuthoritiesClient getGatewayCertificateAuthorities(); + + /** + * Gets the GroupsClient object to access its operations. + * + * @return the GroupsClient object. + */ + GroupsClient getGroups(); + + /** + * Gets the GroupUsersClient object to access its operations. + * + * @return the GroupUsersClient object. + */ + GroupUsersClient getGroupUsers(); + + /** + * Gets the IdentityProvidersClient object to access its operations. + * + * @return the IdentityProvidersClient object. + */ + IdentityProvidersClient getIdentityProviders(); + + /** + * Gets the IssuesClient object to access its operations. + * + * @return the IssuesClient object. + */ + IssuesClient getIssues(); + + /** + * Gets the LoggersClient object to access its operations. + * + * @return the LoggersClient object. + */ + LoggersClient getLoggers(); + + /** + * Gets the NamedValuesClient object to access its operations. + * + * @return the NamedValuesClient object. + */ + NamedValuesClient getNamedValues(); + + /** + * Gets the NetworkStatusClient object to access its operations. + * + * @return the NetworkStatusClient object. + */ + NetworkStatusClient getNetworkStatus(); + + /** + * Gets the NotificationsClient object to access its operations. + * + * @return the NotificationsClient object. + */ + NotificationsClient getNotifications(); + + /** + * Gets the NotificationRecipientUsersClient object to access its operations. + * + * @return the NotificationRecipientUsersClient object. + */ + NotificationRecipientUsersClient getNotificationRecipientUsers(); + + /** + * Gets the NotificationRecipientEmailsClient object to access its operations. + * + * @return the NotificationRecipientEmailsClient object. + */ + NotificationRecipientEmailsClient getNotificationRecipientEmails(); + + /** + * Gets the OpenIdConnectProvidersClient object to access its operations. + * + * @return the OpenIdConnectProvidersClient object. + */ + OpenIdConnectProvidersClient getOpenIdConnectProviders(); + + /** + * Gets the PoliciesClient object to access its operations. + * + * @return the PoliciesClient object. + */ + PoliciesClient getPolicies(); + + /** + * Gets the PolicyDescriptionsClient object to access its operations. + * + * @return the PolicyDescriptionsClient object. + */ + PolicyDescriptionsClient getPolicyDescriptions(); + + /** + * Gets the PortalRevisionsClient object to access its operations. + * + * @return the PortalRevisionsClient object. + */ + PortalRevisionsClient getPortalRevisions(); + + /** + * Gets the PortalSettingsClient object to access its operations. + * + * @return the PortalSettingsClient object. + */ + PortalSettingsClient getPortalSettings(); + + /** + * Gets the SignInSettingsClient object to access its operations. + * + * @return the SignInSettingsClient object. + */ + SignInSettingsClient getSignInSettings(); + + /** + * Gets the SignUpSettingsClient object to access its operations. + * + * @return the SignUpSettingsClient object. + */ + SignUpSettingsClient getSignUpSettings(); + + /** + * Gets the DelegationSettingsClient object to access its operations. + * + * @return the DelegationSettingsClient object. + */ + DelegationSettingsClient getDelegationSettings(); + + /** + * Gets the ProductsClient object to access its operations. + * + * @return the ProductsClient object. + */ + ProductsClient getProducts(); + + /** + * Gets the ProductApisClient object to access its operations. + * + * @return the ProductApisClient object. + */ + ProductApisClient getProductApis(); + + /** + * Gets the ProductGroupsClient object to access its operations. + * + * @return the ProductGroupsClient object. + */ + ProductGroupsClient getProductGroups(); + + /** + * Gets the ProductSubscriptionsClient object to access its operations. + * + * @return the ProductSubscriptionsClient object. + */ + ProductSubscriptionsClient getProductSubscriptions(); + + /** + * Gets the ProductPoliciesClient object to access its operations. + * + * @return the ProductPoliciesClient object. + */ + ProductPoliciesClient getProductPolicies(); + + /** + * Gets the QuotaByCounterKeysClient object to access its operations. + * + * @return the QuotaByCounterKeysClient object. + */ + QuotaByCounterKeysClient getQuotaByCounterKeys(); + + /** + * Gets the QuotaByPeriodKeysClient object to access its operations. + * + * @return the QuotaByPeriodKeysClient object. + */ + QuotaByPeriodKeysClient getQuotaByPeriodKeys(); + + /** + * Gets the RegionsClient object to access its operations. + * + * @return the RegionsClient object. + */ + RegionsClient getRegions(); + + /** + * Gets the ReportsClient object to access its operations. + * + * @return the ReportsClient object. + */ + ReportsClient getReports(); + + /** + * Gets the TenantSettingsClient object to access its operations. + * + * @return the TenantSettingsClient object. + */ + TenantSettingsClient getTenantSettings(); + + /** + * Gets the ApiManagementSkusClient object to access its operations. + * + * @return the ApiManagementSkusClient object. + */ + ApiManagementSkusClient getApiManagementSkus(); + + /** + * Gets the SubscriptionsClient object to access its operations. + * + * @return the SubscriptionsClient object. + */ + SubscriptionsClient getSubscriptions(); + + /** + * Gets the TagResourcesClient object to access its operations. + * + * @return the TagResourcesClient object. + */ + TagResourcesClient getTagResources(); + + /** + * Gets the TenantAccessClient object to access its operations. + * + * @return the TenantAccessClient object. + */ + TenantAccessClient getTenantAccess(); + + /** + * Gets the TenantAccessGitsClient object to access its operations. + * + * @return the TenantAccessGitsClient object. + */ + TenantAccessGitsClient getTenantAccessGits(); + + /** + * Gets the TenantConfigurationsClient object to access its operations. + * + * @return the TenantConfigurationsClient object. + */ + TenantConfigurationsClient getTenantConfigurations(); + + /** + * Gets the UsersClient object to access its operations. + * + * @return the UsersClient object. + */ + UsersClient getUsers(); + + /** + * Gets the UserGroupsClient object to access its operations. + * + * @return the UserGroupsClient object. + */ + UserGroupsClient getUserGroups(); + + /** + * Gets the UserSubscriptionsClient object to access its operations. + * + * @return the UserSubscriptionsClient object. + */ + UserSubscriptionsClient getUserSubscriptions(); + + /** + * Gets the UserIdentitiesClient object to access its operations. + * + * @return the UserIdentitiesClient object. + */ + UserIdentitiesClient getUserIdentities(); + + /** + * Gets the UserConfirmationPasswordsClient object to access its operations. + * + * @return the UserConfirmationPasswordsClient object. + */ + UserConfirmationPasswordsClient getUserConfirmationPasswords(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementOperationsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementOperationsClient.java new file mode 100644 index 0000000000000..6e2e75702e377 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementOperationsClient.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.apimanagement.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.apimanagement.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in ApiManagementOperationsClient. */ +public interface ApiManagementOperationsClient { + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServiceSkusClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServiceSkusClient.java new file mode 100644 index 0000000000000..4dfd2cd0d0558 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServiceSkusClient.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.apimanagement.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.apimanagement.fluent.models.ResourceSkuResultInner; + +/** An instance of this class provides access to all the operations defined in ApiManagementServiceSkusClient. */ +public interface ApiManagementServiceSkusClient { + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableServiceSkus(String resourceGroupName, String serviceName); + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableServiceSkus( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServicesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServicesClient.java new file mode 100644 index 0000000000000..ecab0bbaefe2f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementServicesClient.java @@ -0,0 +1,600 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.ApiManagementServiceGetDomainOwnershipIdentifierResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetSsoTokenResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceNameAvailabilityResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceResourceInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceBackupRestoreParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceCheckNameAvailabilityParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ApiManagementServicesClient. */ +public interface ApiManagementServicesClient { + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginRestore( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginRestore( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context); + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner restore( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner restore( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginBackup( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginBackup( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner backup( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner backup( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context); + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters); + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters, Context context); + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters); + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters, Context context); + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters); + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters, Context context); + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner update( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters); + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner update( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters, Context context); + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginDelete( + String resourceGroupName, String serviceName); + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> beginDelete( + String resourceGroupName, String serviceName, Context context); + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner delete(String resourceGroupName, String serviceName); + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner delete(String resourceGroupName, String serviceName, Context context); + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceGetSsoTokenResultInner getSsoToken(String resourceGroupName, String serviceName); + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSsoTokenWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceNameAvailabilityResultInner checkNameAvailability( + ApiManagementServiceCheckNameAvailabilityParameters parameters); + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + ApiManagementServiceCheckNameAvailabilityParameters parameters, Context context); + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceGetDomainOwnershipIdentifierResultInner getDomainOwnershipIdentifier(); + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDomainOwnershipIdentifierWithResponse( + Context context); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> + beginApplyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiManagementServiceResourceInner> + beginApplyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner applyNetworkConfigurationUpdates(String resourceGroupName, String serviceName); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiManagementServiceResourceInner applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementSkusClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementSkusClient.java new file mode 100644 index 0000000000000..d7ee22a15e6a5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiManagementSkusClient.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.apimanagement.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.apimanagement.fluent.models.ApiManagementSkuInner; + +/** An instance of this class provides access to all the operations defined in ApiManagementSkusClient. */ +public interface ApiManagementSkusClient { + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your 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 the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationPoliciesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationPoliciesClient.java new file mode 100644 index 0000000000000..791e57b82e20b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationPoliciesClient.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.apimanagement.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.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; + +/** An instance of this class provides access to all the operations defined in ApiOperationPoliciesClient. */ +public interface ApiOperationPoliciesClient { + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyCollectionInner listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context); + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 getEntityTag( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId); + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 entity state (Etag) version of the API operation policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + Context context); + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner get( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId); + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters); + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch); + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationsClient.java new file mode 100644 index 0000000000000..9d45fb965b029 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiOperationsClient.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; +import com.azure.resourcemanager.apimanagement.models.OperationUpdateContract; + +/** An instance of this class provides access to all the operations defined in ApiOperationsClient. */ +public interface ApiOperationsClient { + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags, + Context context); + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context); + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationContractInner get(String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context); + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters); + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract parameters); + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract parameters, + Context context); + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String operationId, String ifMatch); + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiPoliciesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiPoliciesClient.java new file mode 100644 index 0000000000000..33a3828eca233 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiPoliciesClient.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.apimanagement.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.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; + +/** An instance of this class provides access to all the operations defined in ApiPoliciesClient. */ +public interface ApiPoliciesClient { + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyCollectionInner listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId); + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 entity state (Etag) version of the API policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, Context context); + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner get(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId); + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters); + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, PolicyIdName policyId, String ifMatch); + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiProductsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiProductsClient.java new file mode 100644 index 0000000000000..b8134ce2b72ab --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiProductsClient.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.apimanagement.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.apimanagement.fluent.models.ProductContractInner; + +/** An instance of this class provides access to all the operations defined in ApiProductsClient. */ +public interface ApiProductsClient { + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApis(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApis( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiReleasesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiReleasesClient.java new file mode 100644 index 0000000000000..d84272d1a4343 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiReleasesClient.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; + +/** An instance of this class provides access to all the operations defined in ApiReleasesClient. */ +public interface ApiReleasesClient { + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String releaseId); + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context); + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiReleaseContractInner get(String resourceGroupName, String serviceName, String apiId, String releaseId); + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context); + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiReleaseContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters); + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiReleaseContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner parameters); + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner parameters, + Context context); + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String releaseId, String ifMatch); + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiRevisionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiRevisionsClient.java new file mode 100644 index 0000000000000..a432d05fd3f5e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiRevisionsClient.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.apimanagement.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.apimanagement.fluent.models.ApiRevisionContractInner; + +/** An instance of this class provides access to all the operations defined in ApiRevisionsClient. */ +public interface ApiRevisionsClient { + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiSchemasClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiSchemasClient.java new file mode 100644 index 0000000000000..5639f4b0bacdc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiSchemasClient.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.apimanagement.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.apimanagement.fluent.models.SchemaContractInner; + +/** An instance of this class provides access to all the operations defined in ApiSchemasClient. */ +public interface ApiSchemasClient { + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String schemaId); + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the schema specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context); + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemaContractInner get(String resourceGroupName, String serviceName, String apiId, String schemaId); + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context); + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SchemaContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch); + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SchemaContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context); + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemaContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch); + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemaContractInner createOrUpdate( + String resourceGroupName, String serviceName, String apiId, String schemaId, SchemaContractInner parameters); + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemaContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String schemaId, String ifMatch); + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + String ifMatch, + Boolean force, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiTagDescriptionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiTagDescriptionsClient.java new file mode 100644 index 0000000000000..a7f3b2434788e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiTagDescriptionsClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.TagDescriptionCreateParameters; + +/** An instance of this class provides access to all the operations defined in ApiTagDescriptionsClient. */ +public interface ApiTagDescriptionsClient { + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String tagDescriptionId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context); + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagDescriptionContractInner get( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId); + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context); + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagDescriptionContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters); + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters, + String ifMatch, + Context context); + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String tagDescriptionId, String ifMatch); + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiVersionSetsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiVersionSetsClient.java new file mode 100644 index 0000000000000..dc58e5e361be6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApiVersionSetsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ApiVersionSetsClient. */ +public interface ApiVersionSetsClient { + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String versionSetId); + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context); + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiVersionSetContractInner get(String resourceGroupName, String serviceName, String versionSetId); + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context); + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiVersionSetContractInner createOrUpdate( + String resourceGroupName, String serviceName, String versionSetId, ApiVersionSetContractInner parameters); + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String versionSetId, + ApiVersionSetContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiVersionSetContractInner update( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters parameters); + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters parameters, + Context context); + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String versionSetId, String ifMatch); + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String versionSetId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApisClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApisClient.java new file mode 100644 index 0000000000000..42224d8dcd089 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ApisClient.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiCreateOrUpdateParameter; +import com.azure.resourcemanager.apimanagement.models.ApiUpdateContract; + +/** An instance of this class provides access to all the operations defined in ApisClient. */ +public interface ApisClient { + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet, + Context context); + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId); + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner get(String resourceGroupName, String serviceName, String apiId); + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch); + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApiContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context); + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch); + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner createOrUpdate( + String resourceGroupName, String serviceName, String apiId, ApiCreateOrUpdateParameter parameters); + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context); + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner update( + String resourceGroupName, String serviceName, String apiId, String ifMatch, ApiUpdateContract parameters); + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + ApiUpdateContract parameters, + Context context); + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String ifMatch); + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + Boolean deleteRevisions, + Context context); + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTags(String resourceGroupName, String serviceName); + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/AuthorizationServersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/AuthorizationServersClient.java new file mode 100644 index 0000000000000..0b99d994c404d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/AuthorizationServersClient.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerUpdateContract; + +/** An instance of this class provides access to all the operations defined in AuthorizationServersClient. */ +public interface AuthorizationServersClient { + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String authsid); + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the authorizationServer specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context); + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationServerContractInner get(String resourceGroupName, String serviceName, String authsid); + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context); + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationServerContractInner createOrUpdate( + String resourceGroupName, String serviceName, String authsid, AuthorizationServerContractInner parameters); + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String authsid, + AuthorizationServerContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationServerContractInner update( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract parameters); + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract parameters, + Context context); + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String authsid, String ifMatch); + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String authsid, String ifMatch, Context context); + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthorizationServerSecretsContractInner listSecrets(String resourceGroupName, String serviceName, String authsid); + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/BackendsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/BackendsClient.java new file mode 100644 index 0000000000000..9ce393ed8cfd4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/BackendsClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; +import com.azure.resourcemanager.apimanagement.models.BackendReconnectContract; +import com.azure.resourcemanager.apimanagement.models.BackendUpdateParameters; + +/** An instance of this class provides access to all the operations defined in BackendsClient. */ +public interface BackendsClient { + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String backendId); + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context); + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendContractInner get(String resourceGroupName, String serviceName, String backendId); + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context); + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendContractInner createOrUpdate( + String resourceGroupName, String serviceName, String backendId, BackendContractInner parameters); + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + BackendContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendContractInner update( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters parameters); + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters parameters, + Context context); + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String backendId, String ifMatch); + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String backendId, String ifMatch, Context context); + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reconnect(String resourceGroupName, String serviceName, String backendId); + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Reconnect request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response reconnectWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + BackendReconnectContract parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CachesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CachesClient.java new file mode 100644 index 0000000000000..017c98a7494f3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CachesClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; +import com.azure.resourcemanager.apimanagement.models.CacheUpdateParameters; + +/** An instance of this class provides access to all the operations defined in CachesClient. */ +public interface CachesClient { + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String cacheId); + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context); + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheContractInner get(String resourceGroupName, String serviceName, String cacheId); + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context); + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheContractInner createOrUpdate( + String resourceGroupName, String serviceName, String cacheId, CacheContractInner parameters); + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String cacheId, + CacheContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CacheContractInner update( + String resourceGroupName, String serviceName, String cacheId, String ifMatch, CacheUpdateParameters parameters); + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String cacheId, + String ifMatch, + CacheUpdateParameters parameters, + Context context); + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String cacheId, String ifMatch); + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String cacheId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CertificatesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CertificatesClient.java new file mode 100644 index 0000000000000..25446a93a608c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/CertificatesClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; +import com.azure.resourcemanager.apimanagement.models.CertificateCreateOrUpdateParameters; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public interface CertificatesClient { + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context); + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String certificateId); + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context); + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateContractInner get(String resourceGroupName, String serviceName, String certificateId); + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context); + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters); + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters, + String ifMatch, + Context context); + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String certificateId, String ifMatch); + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String certificateId, String ifMatch, Context context); + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateContractInner refreshSecret(String resourceGroupName, String serviceName, String certificateId); + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response refreshSecretWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentItemsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentItemsClient.java new file mode 100644 index 0000000000000..4d03556703c13 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentItemsClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; + +/** An instance of this class provides access to all the operations defined in ContentItemsClient. */ +public interface ContentItemsClient { + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId); + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId, Context context); + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String contentTypeId, String contentItemId); + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context); + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentItemContractInner get( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId); + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context); + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentItemContractInner createOrUpdate( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId); + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context); + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String contentTypeId, String contentItemId, String ifMatch); + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentTypesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentTypesClient.java new file mode 100644 index 0000000000000..de65f164de543 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ContentTypesClient.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; + +/** An instance of this class provides access to all the operations defined in ContentTypesClient. */ +public interface ContentTypesClient { + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentTypeContractInner get(String resourceGroupName, String serviceName, String contentTypeId); + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, Context context); + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContentTypeContractInner createOrUpdate(String resourceGroupName, String serviceName, String contentTypeId); + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context); + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String contentTypeId, String ifMatch); + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DelegationSettingsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DelegationSettingsClient.java new file mode 100644 index 0000000000000..33422e523da6d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DelegationSettingsClient.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.PortalDelegationSettingsInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingValidationKeyContractInner; + +/** An instance of this class provides access to all the operations defined in DelegationSettingsClient. */ +public interface DelegationSettingsClient { + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName); + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalDelegationSettingsInner get(String resourceGroupName, String serviceName); + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String serviceName, String ifMatch, PortalDelegationSettingsInner parameters); + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalDelegationSettingsInner parameters, + Context context); + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalDelegationSettingsInner createOrUpdate( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters); + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalDelegationSettingsInner parameters, + String ifMatch, + Context context); + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalSettingValidationKeyContractInner listSecrets(String resourceGroupName, String serviceName); + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DeletedServicesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DeletedServicesClient.java new file mode 100644 index 0000000000000..a1f54ade8ad55 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DeletedServicesClient.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.apimanagement.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.apimanagement.fluent.models.DeletedServiceContractInner; + +/** An instance of this class provides access to all the operations defined in DeletedServicesClient. */ +public interface DeletedServicesClient { + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedServiceContractInner getByName(String serviceName, String location); + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByNameWithResponse(String serviceName, String location, Context context); + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DeletedServiceContractInner> beginPurge( + String serviceName, String location); + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DeletedServiceContractInner> beginPurge( + String serviceName, String location, Context context); + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedServiceContractInner purge(String serviceName, String location); + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedServiceContractInner purge(String serviceName, String location, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DiagnosticsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DiagnosticsClient.java new file mode 100644 index 0000000000000..23afc8ec8ef4e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/DiagnosticsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** An instance of this class provides access to all the operations defined in DiagnosticsClient. */ +public interface DiagnosticsClient { + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String diagnosticId); + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context); + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticContractInner get(String resourceGroupName, String serviceName, String diagnosticId); + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context); + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticContractInner createOrUpdate( + String resourceGroupName, String serviceName, String diagnosticId, DiagnosticContractInner parameters); + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiagnosticContractInner update( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters); + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters, + Context context); + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String diagnosticId, String ifMatch); + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/EmailTemplatesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/EmailTemplatesClient.java new file mode 100644 index 0000000000000..058c37bfc719b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/EmailTemplatesClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.TemplateName; + +/** An instance of this class provides access to all the operations defined in EmailTemplatesClient. */ +public interface EmailTemplatesClient { + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, TemplateName templateName); + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context); + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmailTemplateContractInner get(String resourceGroupName, String serviceName, TemplateName templateName); + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context); + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmailTemplateContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters); + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters, + String ifMatch, + Context context); + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmailTemplateContractInner update( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters parameters); + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters parameters, + Context context); + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, TemplateName templateName, String ifMatch); + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayApisClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayApisClient.java new file mode 100644 index 0000000000000..96c80d6eaaf7f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayApisClient.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.models.AssociationContract; + +/** An instance of this class provides access to all the operations defined in GatewayApisClient. */ +public interface GatewayApisClient { + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String apiId); + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context); + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner createOrUpdate(String resourceGroupName, String serviceName, String gatewayId, String apiId); + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param parameters Association entity details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String apiId, + AssociationContract parameters, + Context context); + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String apiId); + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayCertificateAuthoritiesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayCertificateAuthoritiesClient.java new file mode 100644 index 0000000000000..7a59fbf38665c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayCertificateAuthoritiesClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; + +/** An instance of this class provides access to all the operations defined in GatewayCertificateAuthoritiesClient. */ +public interface GatewayCertificateAuthoritiesClient { + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId); + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String certificateId); + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context); + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayCertificateAuthorityContractInner get( + String resourceGroupName, String serviceName, String gatewayId, String certificateId); + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context); + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayCertificateAuthorityContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters); + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters, + String ifMatch, + Context context); + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String certificateId, String ifMatch); + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayHostnameConfigurationsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayHostnameConfigurationsClient.java new file mode 100644 index 0000000000000..c0f0ead09b9bc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewayHostnameConfigurationsClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; + +/** An instance of this class provides access to all the operations defined in GatewayHostnameConfigurationsClient. */ +public interface GatewayHostnameConfigurationsClient { + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId); + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String hcId); + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context); + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayHostnameConfigurationContractInner get( + String resourceGroupName, String serviceName, String gatewayId, String hcId); + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context); + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayHostnameConfigurationContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters); + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String hcId, String ifMatch); + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewaysClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewaysClient.java new file mode 100644 index 0000000000000..684a10af0f872 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GatewaysClient.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayTokenContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayKeyRegenerationRequestContract; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenRequestContract; + +/** An instance of this class provides access to all the operations defined in GatewaysClient. */ +public interface GatewaysClient { + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context); + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayContractInner get(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context); + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayContractInner createOrUpdate( + String resourceGroupName, String serviceName, String gatewayId, GatewayContractInner parameters); + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayContractInner update( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner parameters); + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner parameters, + Context context); + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String ifMatch); + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String ifMatch, Context context); + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayKeysContractInner listKeys(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context); + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void regenerateKey( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters); + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters, + Context context); + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayTokenContractInner generateToken( + String resourceGroupName, String serviceName, String gatewayId, GatewayTokenRequestContract parameters); + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateTokenWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayTokenRequestContract parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupUsersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupUsersClient.java new file mode 100644 index 0000000000000..4b24997a8a5c2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupUsersClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; + +/** An instance of this class provides access to all the operations defined in GroupUsersClient. */ +public interface GroupUsersClient { + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String groupId); + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String serviceName, + String groupId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkEntityExists(String resourceGroupName, String serviceName, String groupId, String userId); + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context); + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserContractInner create(String resourceGroupName, String serviceName, String groupId, String userId); + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context); + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String groupId, String userId); + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupsClient.java new file mode 100644 index 0000000000000..4e1dabbb876b0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/GroupsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupCreateParameters; +import com.azure.resourcemanager.apimanagement.models.GroupUpdateParameters; + +/** An instance of this class provides access to all the operations defined in GroupsClient. */ +public interface GroupsClient { + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String groupId); + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context); + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GroupContractInner get(String resourceGroupName, String serviceName, String groupId); + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context); + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GroupContractInner createOrUpdate( + String resourceGroupName, String serviceName, String groupId, GroupCreateParameters parameters); + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String groupId, + GroupCreateParameters parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GroupContractInner update( + String resourceGroupName, String serviceName, String groupId, String ifMatch, GroupUpdateParameters parameters); + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String groupId, + String ifMatch, + GroupUpdateParameters parameters, + Context context); + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String groupId, String ifMatch); + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IdentityProvidersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IdentityProvidersClient.java new file mode 100644 index 0000000000000..2bf6a584754f7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IdentityProvidersClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderCreateContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderType; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderUpdateParameters; + +/** An instance of this class provides access to all the operations defined in IdentityProvidersClient. */ +public interface IdentityProvidersClient { + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, IdentityProviderType identityProviderName); + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the identityProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context); + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IdentityProviderContractInner get( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName); + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context); + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IdentityProviderContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters); + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters, + String ifMatch, + Context context); + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IdentityProviderContractInner update( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters parameters); + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters parameters, + Context context); + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, IdentityProviderType identityProviderName, String ifMatch); + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + Context context); + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClientSecretContractInner listSecrets( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName); + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IssuesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IssuesClient.java new file mode 100644 index 0000000000000..d5783849d72bf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/IssuesClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; + +/** An instance of this class provides access to all the operations defined in IssuesClient. */ +public interface IssuesClient { + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IssueContractInner get(String resourceGroupName, String serviceName, String issueId); + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String issueId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/LoggersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/LoggersClient.java new file mode 100644 index 0000000000000..d38faed01f0d7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/LoggersClient.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; +import com.azure.resourcemanager.apimanagement.models.LoggerUpdateContract; + +/** An instance of this class provides access to all the operations defined in LoggersClient. */ +public interface LoggersClient { + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String loggerId); + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context); + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoggerContractInner get(String resourceGroupName, String serviceName, String loggerId); + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context); + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoggerContractInner createOrUpdate( + String resourceGroupName, String serviceName, String loggerId, LoggerContractInner parameters); + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String loggerId, + LoggerContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LoggerContractInner update( + String resourceGroupName, String serviceName, String loggerId, String ifMatch, LoggerUpdateContract parameters); + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String loggerId, + String ifMatch, + LoggerUpdateContract parameters, + Context context); + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String loggerId, String ifMatch); + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String loggerId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NamedValuesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NamedValuesClient.java new file mode 100644 index 0000000000000..1a7f4f05afe59 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NamedValuesClient.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.NamedValueContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner; +import com.azure.resourcemanager.apimanagement.models.NamedValueCreateContract; +import com.azure.resourcemanager.apimanagement.models.NamedValueUpdateParameters; + +/** An instance of this class provides access to all the operations defined in NamedValuesClient. */ +public interface NamedValuesClient { + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context); + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner get(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NamedValueContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch); + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NamedValueContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context); + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch); + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner createOrUpdate( + String resourceGroupName, String serviceName, String namedValueId, NamedValueCreateContract parameters); + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context); + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NamedValueContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters); + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NamedValueContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters, + Context context); + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner update( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters); + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner update( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters, + Context context); + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String namedValueId, String ifMatch); + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String namedValueId, String ifMatch, Context context); + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueSecretContractInner listValue(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listValueWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NamedValueContractInner> beginRefreshSecret( + String resourceGroupName, String serviceName, String namedValueId); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NamedValueContractInner> beginRefreshSecret( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner refreshSecret(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NamedValueContractInner refreshSecret( + String resourceGroupName, String serviceName, String namedValueId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NetworkStatusClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NetworkStatusClient.java new file mode 100644 index 0000000000000..d42ea5789eb81 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NetworkStatusClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.NetworkStatusContractByLocationInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in NetworkStatusClient. */ +public interface NetworkStatusClient { + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listByService(String resourceGroupName, String serviceName); + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkStatusContractInner listByLocation(String resourceGroupName, String serviceName, String locationName); + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByLocationWithResponse( + String resourceGroupName, String serviceName, String locationName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientEmailsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientEmailsClient.java new file mode 100644 index 0000000000000..8927638acacf9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientEmailsClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.RecipientEmailCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; + +/** An instance of this class provides access to all the operations defined in NotificationRecipientEmailsClient. */ +public interface NotificationRecipientEmailsClient { + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecipientEmailCollectionInner listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context); + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String email); + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, String email, Context context); + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecipientEmailContractInner createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String email); + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, String email, Context context); + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, NotificationName notificationName, String email); + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, String email, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientUsersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientUsersClient.java new file mode 100644 index 0000000000000..3277e069d6dd6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationRecipientUsersClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.RecipientUserCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; + +/** An instance of this class provides access to all the operations defined in NotificationRecipientUsersClient. */ +public interface NotificationRecipientUsersClient { + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecipientUserCollectionInner listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context); + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId); + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEntityExistsWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context); + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecipientUserContractInner createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId); + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context); + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, NotificationName notificationName, String userId); + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationsClient.java new file mode 100644 index 0000000000000..0538e3ae351d7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/NotificationsClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; + +/** An instance of this class provides access to all the operations defined in NotificationsClient. */ +public interface NotificationsClient { + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context); + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NotificationContractInner get(String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context); + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NotificationContractInner createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OpenIdConnectProvidersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OpenIdConnectProvidersClient.java new file mode 100644 index 0000000000000..18a1f766d2a38 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OpenIdConnectProvidersClient.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderUpdateContract; + +/** An instance of this class provides access to all the operations defined in OpenIdConnectProvidersClient. */ +public interface OpenIdConnectProvidersClient { + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String opid); + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, String opid, Context context); + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenidConnectProviderContractInner get(String resourceGroupName, String serviceName, String opid); + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String opid, Context context); + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenidConnectProviderContractInner createOrUpdate( + String resourceGroupName, String serviceName, String opid, OpenidConnectProviderContractInner parameters); + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String opid, + OpenidConnectProviderContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenidConnectProviderContractInner update( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract parameters); + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract parameters, + Context context); + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String opid, String ifMatch); + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String opid, String ifMatch, Context context); + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClientSecretContractInner listSecrets(String resourceGroupName, String serviceName, String opid); + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String opid, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OperationsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OperationsClient.java new file mode 100644 index 0000000000000..a9c70b5427d2e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/OperationsClient.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.apimanagement.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.apimanagement.fluent.models.TagResourceContractInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTags(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PoliciesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PoliciesClient.java new file mode 100644 index 0000000000000..326d8ceb253c7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PoliciesClient.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; + +/** An instance of this class provides access to all the operations defined in PoliciesClient. */ +public interface PoliciesClient { + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyCollectionInner listByService(String resourceGroupName, String serviceName); + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, PolicyIdName policyId); + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 entity state (Etag) version of the Global policy definition in the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, Context context); + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner get(String resourceGroupName, String serviceName, PolicyIdName policyId); + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner createOrUpdate( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyContractInner parameters); + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, PolicyIdName policyId, String ifMatch); + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PolicyDescriptionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PolicyDescriptionsClient.java new file mode 100644 index 0000000000000..2df634efe09bb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PolicyDescriptionsClient.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.apimanagement.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.apimanagement.fluent.models.PolicyDescriptionCollectionInner; +import com.azure.resourcemanager.apimanagement.models.PolicyScopeContract; + +/** An instance of this class provides access to all the operations defined in PolicyDescriptionsClient. */ +public interface PolicyDescriptionsClient { + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyDescriptionCollectionInner listByService(String resourceGroupName, String serviceName); + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param scope Policy scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, PolicyScopeContract scope, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalRevisionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalRevisionsClient.java new file mode 100644 index 0000000000000..e78b14cbab392 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalRevisionsClient.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.apimanagement.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.apimanagement.fluent.models.PortalRevisionContractInner; + +/** An instance of this class provides access to all the operations defined in PortalRevisionsClient. */ +public interface PortalRevisionsClient { + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String portalRevisionId); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalRevisionContractInner get(String resourceGroupName, String serviceName, String portalRevisionId); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context); + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PortalRevisionContractInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner parameters); + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PortalRevisionContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner parameters, + Context context); + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalRevisionContractInner createOrUpdate( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner parameters); + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalRevisionContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner parameters, + Context context); + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PortalRevisionContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters); + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PortalRevisionContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters, + Context context); + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalRevisionContractInner update( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters); + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalRevisionContractInner update( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalSettingsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalSettingsClient.java new file mode 100644 index 0000000000000..bec6a69da5dd0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/PortalSettingsClient.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.apimanagement.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.apimanagement.fluent.models.PortalSettingsCollectionInner; + +/** An instance of this class provides access to all the operations defined in PortalSettingsClient. */ +public interface PortalSettingsClient { + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalSettingsCollectionInner listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductApisClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductApisClient.java new file mode 100644 index 0000000000000..9216fd6686965 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductApisClient.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; + +/** An instance of this class provides access to all the operations defined in ProductApisClient. */ +public interface ProductApisClient { + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkEntityExists(String resourceGroupName, String serviceName, String productId, String apiId); + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context); + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiContractInner createOrUpdate(String resourceGroupName, String serviceName, String productId, String apiId); + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context); + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, String apiId); + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductGroupsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductGroupsClient.java new file mode 100644 index 0000000000000..a911a76dec04d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductGroupsClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; + +/** An instance of this class provides access to all the operations defined in ProductGroupsClient. */ +public interface ProductGroupsClient { + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkEntityExists(String resourceGroupName, String serviceName, String productId, String groupId); + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context); + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GroupContractInner createOrUpdate(String resourceGroupName, String serviceName, String productId, String groupId); + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context); + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, String groupId); + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductPoliciesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductPoliciesClient.java new file mode 100644 index 0000000000000..72f6e2e977303 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductPoliciesClient.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; + +/** An instance of this class provides access to all the operations defined in ProductPoliciesClient. */ +public interface ProductPoliciesClient { + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyCollectionInner listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByProductWithResponse( + String resourceGroupName, String serviceName, String productId, Context context); + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId); + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 ETag of the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId, Context context); + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner get(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId); + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters); + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, PolicyIdName policyId, String ifMatch); + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductSubscriptionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductSubscriptionsClient.java new file mode 100644 index 0000000000000..6157800c42348 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductSubscriptionsClient.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.apimanagement.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.apimanagement.fluent.models.SubscriptionContractInner; + +/** An instance of this class provides access to all the operations defined in ProductSubscriptionsClient. */ +public interface ProductSubscriptionsClient { + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String productId); + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductsClient.java new file mode 100644 index 0000000000000..39a253df845b3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ProductsClient.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ProductUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ProductsClient. */ +public interface ProductsClient { + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags, + Context context); + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String productId); + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, Context context); + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductContractInner get(String resourceGroupName, String serviceName, String productId); + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String productId, Context context); + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductContractInner createOrUpdate( + String resourceGroupName, String serviceName, String productId, ProductContractInner parameters); + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + ProductContractInner parameters, + String ifMatch, + Context context); + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductContractInner update( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters parameters); + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters parameters, + Context context); + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, String ifMatch); + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + Boolean deleteSubscriptions, + Context context); + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTags(String resourceGroupName, String serviceName); + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByCounterKeysClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByCounterKeysClient.java new file mode 100644 index 0000000000000..b436a841102a7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByCounterKeysClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.QuotaCounterCollectionInner; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract; + +/** An instance of this class provides access to all the operations defined in QuotaByCounterKeysClient. */ +public interface QuotaByCounterKeysClient { + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaCounterCollectionInner listByService(String resourceGroupName, String serviceName, String quotaCounterKey); + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, Context context); + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaCounterCollectionInner update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters); + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByPeriodKeysClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByPeriodKeysClient.java new file mode 100644 index 0000000000000..f251eb234583d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/QuotaByPeriodKeysClient.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.QuotaCounterContractInner; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract; + +/** An instance of this class provides access to all the operations defined in QuotaByPeriodKeysClient. */ +public interface QuotaByPeriodKeysClient { + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaCounterContractInner get( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey); + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey, Context context); + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaCounterContractInner update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters); + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/RegionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/RegionsClient.java new file mode 100644 index 0000000000000..8e89633e72eb6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/RegionsClient.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.apimanagement.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.apimanagement.fluent.models.RegionContractInner; + +/** An instance of this class provides access to all the operations defined in RegionsClient. */ +public interface RegionsClient { + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ReportsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ReportsClient.java new file mode 100644 index 0000000000000..063b22088918a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/ReportsClient.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.ReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner; +import java.time.Duration; + +/** An instance of this class provides access to all the operations defined in ReportsClient. */ +public interface ReportsClient { + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByUser(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByUser( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOperation( + String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGeo(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGeo( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription( + String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTime( + String resourceGroupName, String serviceName, String filter, Duration interval); + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTime( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignInSettingsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignInSettingsClient.java new file mode 100644 index 0000000000000..8395c988648a7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignInSettingsClient.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.apimanagement.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.apimanagement.fluent.models.PortalSigninSettingsInner; + +/** An instance of this class provides access to all the operations defined in SignInSettingsClient. */ +public interface SignInSettingsClient { + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName); + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignInSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalSigninSettingsInner get(String resourceGroupName, String serviceName); + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String serviceName, String ifMatch, PortalSigninSettingsInner parameters); + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSigninSettingsInner parameters, + Context context); + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalSigninSettingsInner createOrUpdate( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters); + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSigninSettingsInner parameters, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignUpSettingsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignUpSettingsClient.java new file mode 100644 index 0000000000000..d762ab98a1791 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SignUpSettingsClient.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.apimanagement.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.apimanagement.fluent.models.PortalSignupSettingsInner; + +/** An instance of this class provides access to all the operations defined in SignUpSettingsClient. */ +public interface SignUpSettingsClient { + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName); + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignUpSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalSignupSettingsInner get(String resourceGroupName, String serviceName); + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String serviceName, String ifMatch, PortalSignupSettingsInner parameters); + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSignupSettingsInner parameters, + Context context); + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PortalSignupSettingsInner createOrUpdate( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters); + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSignupSettingsInner parameters, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SubscriptionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SubscriptionsClient.java new file mode 100644 index 0000000000000..f01f17b079845 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/SubscriptionsClient.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.SubscriptionCreateParameters; +import com.azure.resourcemanager.apimanagement.models.SubscriptionUpdateParameters; + +/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ +public interface SubscriptionsClient { + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String sid); + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the apimanagement subscription specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionContractInner get(String resourceGroupName, String serviceName, String sid); + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionContractInner createOrUpdate( + String resourceGroupName, String serviceName, String sid, SubscriptionCreateParameters parameters); + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType, + Context context); + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionContractInner update( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters); + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType, + Context context); + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String sid, String ifMatch); + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String sid, String ifMatch, Context context); + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 regeneratePrimaryKey(String resourceGroupName, String serviceName, String sid); + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 regenerateSecondaryKey(String resourceGroupName, String serviceName, String sid); + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionKeysContractInner listSecrets(String resourceGroupName, String serviceName, String sid); + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagResourcesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagResourcesClient.java new file mode 100644 index 0000000000000..0c637edbd2974 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagResourcesClient.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.TagResourceContractInner; + +/** An instance of this class provides access to all the operations defined in TagResourcesClient. */ +public interface TagResourcesClient { + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagsClient.java new file mode 100644 index 0000000000000..20a4ee1b99cc1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TagsClient.java @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; +import com.azure.resourcemanager.apimanagement.models.TagCreateUpdateParameters; + +/** An instance of this class provides access to all the operations defined in TagsClient. */ +public interface TagsClient { + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityStateByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityStateByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner getByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner assignToOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response assignToOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFromOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response detachFromOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityStateByApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityStateByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner getByApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner assignToApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response assignToApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFromApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response detachFromApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityStateByProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityStateByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner getByProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner assignToProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response assignToProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFromProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response detachFromProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String scope, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityState(String resourceGroupName, String serviceName, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityStateWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context); + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner get(String resourceGroupName, String serviceName, String tagId); + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context); + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner createOrUpdate( + String resourceGroupName, String serviceName, String tagId, TagCreateUpdateParameters parameters); + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String tagId, + TagCreateUpdateParameters parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagContractInner update( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters parameters); + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters parameters, + Context context); + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String tagId, String ifMatch); + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String serviceName, String tagId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessClient.java new file mode 100644 index 0000000000000..720957c5f1f62 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessClient.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.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AccessIdName; +import com.azure.resourcemanager.apimanagement.models.AccessInformationCreateParameters; +import com.azure.resourcemanager.apimanagement.models.AccessInformationUpdateParameters; + +/** An instance of this class provides access to all the operations defined in TenantAccessClient. */ +public interface TenantAccessClient { + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context); + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getEntityTag(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessInformationContractInner get(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessInformationContractInner create( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters parameters); + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters parameters, + Context context); + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessInformationContractInner update( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters parameters); + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters parameters, + Context context); + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessInformationSecretsContractInner listSecrets( + String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessGitsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessGitsClient.java new file mode 100644 index 0000000000000..f957afe468129 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantAccessGitsClient.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.apimanagement.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.apimanagement.models.AccessIdName; + +/** An instance of this class provides access to all the operations defined in TenantAccessGitsClient. */ +public interface TenantAccessGitsClient { + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantConfigurationsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantConfigurationsClient.java new file mode 100644 index 0000000000000..e5680775570e7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantConfigurationsClient.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.apimanagement.fluent.models.OperationResultContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantConfigurationSyncStateContractInner; +import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName; +import com.azure.resourcemanager.apimanagement.models.DeployConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.SaveConfigurationParameter; + +/** An instance of this class provides access to all the operations defined in TenantConfigurationsClient. */ +public interface TenantConfigurationsClient { + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResultContractInner> beginDeploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters); + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResultContractInner> beginDeploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context); + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultContractInner deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters); + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultContractInner deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context); + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResultContractInner> beginSave( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters); + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResultContractInner> beginSave( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context); + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultContractInner save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters); + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultContractInner save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context); + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResultContractInner> beginValidate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters); + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResultContractInner> beginValidate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context); + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultContractInner validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters); + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultContractInner validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context); + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TenantConfigurationSyncStateContractInner getSyncState( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName); + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSyncStateWithResponse( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantSettingsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantSettingsClient.java new file mode 100644 index 0000000000000..36fac7a0e5c31 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/TenantSettingsClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; +import com.azure.resourcemanager.apimanagement.models.SettingsTypeName; + +/** An instance of this class provides access to all the operations defined in TenantSettingsClient. */ +public interface TenantSettingsClient { + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context); + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TenantSettingsContractInner get(String resourceGroupName, String serviceName, SettingsTypeName settingsType); + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, SettingsTypeName settingsType, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserConfirmationPasswordsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserConfirmationPasswordsClient.java new file mode 100644 index 0000000000000..3e317ff82a56b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserConfirmationPasswordsClient.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.apimanagement.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.apimanagement.models.AppType; + +/** An instance of this class provides access to all the operations defined in UserConfirmationPasswordsClient. */ +public interface UserConfirmationPasswordsClient { + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 send(String resourceGroupName, String serviceName, String userId); + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sendWithResponse( + String resourceGroupName, String serviceName, String userId, AppType appType, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserGroupsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserGroupsClient.java new file mode 100644 index 0000000000000..57ca467d1c93d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserGroupsClient.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.models.GroupContractInner; + +/** An instance of this class provides access to all the operations defined in UserGroupsClient. */ +public interface UserGroupsClient { + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String userId); + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserIdentitiesClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserIdentitiesClient.java new file mode 100644 index 0000000000000..829273e2bb80f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserIdentitiesClient.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.apimanagement.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.apimanagement.fluent.models.UserIdentityContractInner; + +/** An instance of this class provides access to all the operations defined in UserIdentitiesClient. */ +public interface UserIdentitiesClient { + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String userId); + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String userId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserSubscriptionsClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserSubscriptionsClient.java new file mode 100644 index 0000000000000..a8a97b94d9546 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UserSubscriptionsClient.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; + +/** An instance of this class provides access to all the operations defined in UserSubscriptionsClient. */ +public interface UserSubscriptionsClient { + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String userId); + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SubscriptionContractInner get(String resourceGroupName, String serviceName, String userId, String sid); + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String userId, String sid, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UsersClient.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UsersClient.java new file mode 100644 index 0000000000000..1f4b51d397e94 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/UsersClient.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GenerateSsoUrlResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserTokenResultInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.UserCreateParameters; +import com.azure.resourcemanager.apimanagement.models.UserTokenParameters; +import com.azure.resourcemanager.apimanagement.models.UserUpdateParameters; + +/** An instance of this class provides access to all the operations defined in UsersClient. */ +public interface UsersClient { + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + Context context); + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String userId); + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String userId, Context context); + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserContractInner get(String resourceGroupName, String serviceName, String userId); + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String userId, Context context); + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserContractInner createOrUpdate( + String resourceGroupName, String serviceName, String userId, UserCreateParameters parameters); + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param notify Send an Email notification to the User. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String userId, + UserCreateParameters parameters, + Boolean notify, + String ifMatch, + Context context); + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserContractInner update( + String resourceGroupName, String serviceName, String userId, String ifMatch, UserUpdateParameters parameters); + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + UserUpdateParameters parameters, + Context context); + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String userId, String ifMatch); + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType, + Context context); + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateSsoUrlResultInner generateSsoUrl(String resourceGroupName, String serviceName, String userId); + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateSsoUrlWithResponse( + String resourceGroupName, String serviceName, String userId, Context context); + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserTokenResultInner getSharedAccessToken( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters); + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSharedAccessTokenWithResponse( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationContractInner.java new file mode 100644 index 0000000000000..1c929ee8c438a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tenant Settings. */ +@JsonFlatten +@Fluent +public class AccessInformationContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessInformationContractInner.class); + + /* + * Access Information type ('access' or 'gitAccess') + */ + @JsonProperty(value = "properties.id") + private String idPropertiesId; + + /* + * Principal (User) Identifier. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /* + * Determines whether direct access is enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Get the idPropertiesId property: Access Information type ('access' or 'gitAccess'). + * + * @return the idPropertiesId value. + */ + public String idPropertiesId() { + return this.idPropertiesId; + } + + /** + * Set the idPropertiesId property: Access Information type ('access' or 'gitAccess'). + * + * @param idPropertiesId the idPropertiesId value to set. + * @return the AccessInformationContractInner object itself. + */ + public AccessInformationContractInner withIdPropertiesId(String idPropertiesId) { + this.idPropertiesId = idPropertiesId; + return this; + } + + /** + * Get the principalId property: Principal (User) Identifier. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Principal (User) Identifier. + * + * @param principalId the principalId value to set. + * @return the AccessInformationContractInner object itself. + */ + public AccessInformationContractInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the enabled property: Determines whether direct access is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether direct access is enabled. + * + * @param enabled the enabled value to set. + * @return the AccessInformationContractInner object itself. + */ + public AccessInformationContractInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationSecretsContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationSecretsContractInner.java new file mode 100644 index 0000000000000..7484d1d542227 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AccessInformationSecretsContractInner.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.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; + +/** Tenant access information contract of the API Management service. */ +@Fluent +public final class AccessInformationSecretsContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessInformationSecretsContractInner.class); + + /* + * Access Information type ('access' or 'gitAccess') + */ + @JsonProperty(value = "id") + private String id; + + /* + * Principal (User) Identifier. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * Primary access key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * Secondary access key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /* + * Determines whether direct access is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the id property: Access Information type ('access' or 'gitAccess'). + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Access Information type ('access' or 'gitAccess'). + * + * @param id the id value to set. + * @return the AccessInformationSecretsContractInner object itself. + */ + public AccessInformationSecretsContractInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the principalId property: Principal (User) Identifier. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Principal (User) Identifier. + * + * @param principalId the principalId value to set. + * @return the AccessInformationSecretsContractInner object itself. + */ + public AccessInformationSecretsContractInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the primaryKey property: Primary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @param primaryKey the primaryKey value to set. + * @return the AccessInformationSecretsContractInner object itself. + */ + public AccessInformationSecretsContractInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @param secondaryKey the secondaryKey value to set. + * @return the AccessInformationSecretsContractInner object itself. + */ + public AccessInformationSecretsContractInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the enabled property: Determines whether direct access is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether direct access is enabled. + * + * @param enabled the enabled value to set. + * @return the AccessInformationSecretsContractInner object itself. + */ + public AccessInformationSecretsContractInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiContractInner.java new file mode 100644 index 0000000000000..494768defee00 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiContractInner.java @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.ApiType; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetContractDetails; +import com.azure.resourcemanager.apimanagement.models.AuthenticationSettingsContract; +import com.azure.resourcemanager.apimanagement.models.Protocol; +import com.azure.resourcemanager.apimanagement.models.SubscriptionKeyParameterNamesContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Api details. */ +@JsonFlatten +@Fluent +public class ApiContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiContractInner.class); + + /* + * Description of the API. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Collection of authentication settings included into this API. + */ + @JsonProperty(value = "properties.authenticationSettings") + private AuthenticationSettingsContract authenticationSettings; + + /* + * Protocols over which API is made available. + */ + @JsonProperty(value = "properties.subscriptionKeyParameterNames") + private SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames; + + /* + * Type of API. + */ + @JsonProperty(value = "properties.type") + private ApiType apiType; + + /* + * Describes the Revision of the Api. If no value is provided, default + * revision 1 is created + */ + @JsonProperty(value = "properties.apiRevision") + private String apiRevision; + + /* + * Indicates the Version identifier of the API if the API is versioned + */ + @JsonProperty(value = "properties.apiVersion") + private String apiVersion; + + /* + * Indicates if API revision is current api revision. + */ + @JsonProperty(value = "properties.isCurrent") + private Boolean isCurrent; + + /* + * Indicates if API revision is accessible via the gateway. + */ + @JsonProperty(value = "properties.isOnline", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOnline; + + /* + * Description of the Api Revision. + */ + @JsonProperty(value = "properties.apiRevisionDescription") + private String apiRevisionDescription; + + /* + * Description of the Api Version. + */ + @JsonProperty(value = "properties.apiVersionDescription") + private String apiVersionDescription; + + /* + * A resource identifier for the related ApiVersionSet. + */ + @JsonProperty(value = "properties.apiVersionSetId") + private String apiVersionSetId; + + /* + * Specifies whether an API or Product subscription is required for + * accessing the API. + */ + @JsonProperty(value = "properties.subscriptionRequired") + private Boolean subscriptionRequired; + + /* + * API identifier of the source API. + */ + @JsonProperty(value = "properties.sourceApiId") + private String sourceApiId; + + /* + * API name. Must be 1 to 300 characters long. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Absolute URL of the backend service implementing this API. Cannot be + * more than 2000 characters long. + */ + @JsonProperty(value = "properties.serviceUrl") + private String serviceUrl; + + /* + * Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API + * endpoint base URL specified during the service instance creation to form + * a public URL for this API. + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * Describes on which protocols the operations in this API can be invoked. + */ + @JsonProperty(value = "properties.protocols") + private List protocols; + + /* + * Version set details + */ + @JsonProperty(value = "properties.apiVersionSet") + private ApiVersionSetContractDetails apiVersionSet; + + /** + * Get the description property: Description of the API. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the API. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authenticationSettings property: Collection of authentication settings included into this API. + * + * @return the authenticationSettings value. + */ + public AuthenticationSettingsContract authenticationSettings() { + return this.authenticationSettings; + } + + /** + * Set the authenticationSettings property: Collection of authentication settings included into this API. + * + * @param authenticationSettings the authenticationSettings value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings) { + this.authenticationSettings = authenticationSettings; + return this; + } + + /** + * Get the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @return the subscriptionKeyParameterNames value. + */ + public SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames() { + return this.subscriptionKeyParameterNames; + } + + /** + * Set the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @param subscriptionKeyParameterNames the subscriptionKeyParameterNames value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + this.subscriptionKeyParameterNames = subscriptionKeyParameterNames; + return this; + } + + /** + * Get the apiType property: Type of API. + * + * @return the apiType value. + */ + public ApiType apiType() { + return this.apiType; + } + + /** + * Set the apiType property: Type of API. + * + * @param apiType the apiType value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiType(ApiType apiType) { + this.apiType = apiType; + return this; + } + + /** + * Get the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @return the apiRevision value. + */ + public String apiRevision() { + return this.apiRevision; + } + + /** + * Set the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @param apiRevision the apiRevision value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiRevision(String apiRevision) { + this.apiRevision = apiRevision; + return this; + } + + /** + * Get the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @param apiVersion the apiVersion value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get the isCurrent property: Indicates if API revision is current api revision. + * + * @return the isCurrent value. + */ + public Boolean isCurrent() { + return this.isCurrent; + } + + /** + * Set the isCurrent property: Indicates if API revision is current api revision. + * + * @param isCurrent the isCurrent value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withIsCurrent(Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get the isOnline property: Indicates if API revision is accessible via the gateway. + * + * @return the isOnline value. + */ + public Boolean isOnline() { + return this.isOnline; + } + + /** + * Get the apiRevisionDescription property: Description of the Api Revision. + * + * @return the apiRevisionDescription value. + */ + public String apiRevisionDescription() { + return this.apiRevisionDescription; + } + + /** + * Set the apiRevisionDescription property: Description of the Api Revision. + * + * @param apiRevisionDescription the apiRevisionDescription value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiRevisionDescription(String apiRevisionDescription) { + this.apiRevisionDescription = apiRevisionDescription; + return this; + } + + /** + * Get the apiVersionDescription property: Description of the Api Version. + * + * @return the apiVersionDescription value. + */ + public String apiVersionDescription() { + return this.apiVersionDescription; + } + + /** + * Set the apiVersionDescription property: Description of the Api Version. + * + * @param apiVersionDescription the apiVersionDescription value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiVersionDescription(String apiVersionDescription) { + this.apiVersionDescription = apiVersionDescription; + return this; + } + + /** + * Get the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @return the apiVersionSetId value. + */ + public String apiVersionSetId() { + return this.apiVersionSetId; + } + + /** + * Set the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @param apiVersionSetId the apiVersionSetId value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiVersionSetId(String apiVersionSetId) { + this.apiVersionSetId = apiVersionSetId; + return this; + } + + /** + * Get the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Get the sourceApiId property: API identifier of the source API. + * + * @return the sourceApiId value. + */ + public String sourceApiId() { + return this.sourceApiId; + } + + /** + * Set the sourceApiId property: API identifier of the source API. + * + * @param sourceApiId the sourceApiId value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withSourceApiId(String sourceApiId) { + this.sourceApiId = sourceApiId; + return this; + } + + /** + * Get the displayName property: API name. Must be 1 to 300 characters long. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: API name. Must be 1 to 300 characters long. + * + * @param displayName the displayName value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Set the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @param serviceUrl the serviceUrl value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + return this; + } + + /** + * Get the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @param path the path value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @param protocols the protocols value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the apiVersionSet property: Version set details. + * + * @return the apiVersionSet value. + */ + public ApiVersionSetContractDetails apiVersionSet() { + return this.apiVersionSet; + } + + /** + * Set the apiVersionSet property: Version set details. + * + * @param apiVersionSet the apiVersionSet value to set. + * @return the ApiContractInner object itself. + */ + public ApiContractInner withApiVersionSet(ApiVersionSetContractDetails apiVersionSet) { + this.apiVersionSet = apiVersionSet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationSettings() != null) { + authenticationSettings().validate(); + } + if (subscriptionKeyParameterNames() != null) { + subscriptionKeyParameterNames().validate(); + } + if (apiVersionSet() != null) { + apiVersionSet().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiExportResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiExportResultInner.java new file mode 100644 index 0000000000000..2103ff68bc5a9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiExportResultInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.ApiExportResultValue; +import com.azure.resourcemanager.apimanagement.models.ExportResultFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** API Export result. */ +@Fluent +public final class ApiExportResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiExportResultInner.class); + + /* + * ResourceId of the API which was exported. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Format in which the Api Details are exported to the Storage Blob with + * Sas Key valid for 5 minutes. + */ + @JsonProperty(value = "format") + private ExportResultFormat exportResultFormat; + + /* + * The object defining the schema of the exported Api Detail + */ + @JsonProperty(value = "value") + private ApiExportResultValue value; + + /** + * Get the id property: ResourceId of the API which was exported. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ResourceId of the API which was exported. + * + * @param id the id value to set. + * @return the ApiExportResultInner object itself. + */ + public ApiExportResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the exportResultFormat property: Format in which the Api Details are exported to the Storage Blob with Sas + * Key valid for 5 minutes. + * + * @return the exportResultFormat value. + */ + public ExportResultFormat exportResultFormat() { + return this.exportResultFormat; + } + + /** + * Set the exportResultFormat property: Format in which the Api Details are exported to the Storage Blob with Sas + * Key valid for 5 minutes. + * + * @param exportResultFormat the exportResultFormat value to set. + * @return the ApiExportResultInner object itself. + */ + public ApiExportResultInner withExportResultFormat(ExportResultFormat exportResultFormat) { + this.exportResultFormat = exportResultFormat; + return this; + } + + /** + * Get the value property: The object defining the schema of the exported Api Detail. + * + * @return the value value. + */ + public ApiExportResultValue value() { + return this.value; + } + + /** + * Set the value property: The object defining the schema of the exported Api Detail. + * + * @param value the value value to set. + * @return the ApiExportResultInner object itself. + */ + public ApiExportResultInner withValue(ApiExportResultValue value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetDomainOwnershipIdentifierResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetDomainOwnershipIdentifierResultInner.java new file mode 100644 index 0000000000000..6b72785bc2fc4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetDomainOwnershipIdentifierResultInner.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.apimanagement.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; + +/** Response of the GetDomainOwnershipIdentifier operation. */ +@Immutable +public final class ApiManagementServiceGetDomainOwnershipIdentifierResultInner { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ApiManagementServiceGetDomainOwnershipIdentifierResultInner.class); + + /* + * The domain ownership identifier value. + */ + @JsonProperty(value = "domainOwnershipIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String domainOwnershipIdentifier; + + /** + * Get the domainOwnershipIdentifier property: The domain ownership identifier value. + * + * @return the domainOwnershipIdentifier value. + */ + public String domainOwnershipIdentifier() { + return this.domainOwnershipIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetSsoTokenResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetSsoTokenResultInner.java new file mode 100644 index 0000000000000..651a8bae4711e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceGetSsoTokenResultInner.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.apimanagement.fluent.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 response of the GetSsoToken operation. */ +@Fluent +public final class ApiManagementServiceGetSsoTokenResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceGetSsoTokenResultInner.class); + + /* + * Redirect URL to the Publisher Portal containing the SSO token. + */ + @JsonProperty(value = "redirectUri") + private String redirectUri; + + /** + * Get the redirectUri property: Redirect URL to the Publisher Portal containing the SSO token. + * + * @return the redirectUri value. + */ + public String redirectUri() { + return this.redirectUri; + } + + /** + * Set the redirectUri property: Redirect URL to the Publisher Portal containing the SSO token. + * + * @param redirectUri the redirectUri value to set. + * @return the ApiManagementServiceGetSsoTokenResultInner object itself. + */ + public ApiManagementServiceGetSsoTokenResultInner withRedirectUri(String redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceNameAvailabilityResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..a9a63904f52cd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceNameAvailabilityResultInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response of the CheckNameAvailability operation. */ +@Fluent +public final class ApiManagementServiceNameAvailabilityResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApiManagementServiceNameAvailabilityResultInner.class); + + /* + * True if the name is available and can be used to create a new API + * Management service; otherwise false. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * If reason == invalid, provide the user with the reason why the given + * name is invalid, and provide the resource naming requirements so that + * the user can select a valid name. If reason == AlreadyExists, explain + * that is already in use, and direct them to select a + * different name. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Invalid indicates the name provided does not match the resource + * provider’s naming requirements (incorrect length, unsupported + * characters, etc.) AlreadyExists indicates that the name is already in + * use and is therefore unavailable. + */ + @JsonProperty(value = "reason") + private NameAvailabilityReason reason; + + /** + * Get the nameAvailable property: True if the name is available and can be used to create a new API Management + * service; otherwise false. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the message property: If reason == invalid, provide the user with the reason why the given name is invalid, + * and provide the resource naming requirements so that the user can select a valid name. If reason == + * AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the reason property: Invalid indicates the name provided does not match the resource provider’s naming + * requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in + * use and is therefore unavailable. + * + * @return the reason value. + */ + public NameAvailabilityReason reason() { + return this.reason; + } + + /** + * Set the reason property: Invalid indicates the name provided does not match the resource provider’s naming + * requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in + * use and is therefore unavailable. + * + * @param reason the reason value to set. + * @return the ApiManagementServiceNameAvailabilityResultInner object itself. + */ + public ApiManagementServiceNameAvailabilityResultInner withReason(NameAvailabilityReason reason) { + this.reason = reason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceResourceInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceResourceInner.java new file mode 100644 index 0000000000000..6972b7ab03bcb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementServiceResourceInner.java @@ -0,0 +1,836 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.AdditionalLocation; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceIdentity; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties; +import com.azure.resourcemanager.apimanagement.models.ApiVersionConstraint; +import com.azure.resourcemanager.apimanagement.models.ApimResource; +import com.azure.resourcemanager.apimanagement.models.CertificateConfiguration; +import com.azure.resourcemanager.apimanagement.models.HostnameConfiguration; +import com.azure.resourcemanager.apimanagement.models.VirtualNetworkConfiguration; +import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** A single API Management service resource in List or Get response. */ +@JsonFlatten +@Fluent +public class ApiManagementServiceResourceInner extends ApimResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceResourceInner.class); + + /* + * SKU properties of the API Management service. + */ + @JsonProperty(value = "sku", required = true) + private ApiManagementServiceSkuProperties sku; + + /* + * Managed service identity of the Api Management service. + */ + @JsonProperty(value = "identity") + private ApiManagementServiceIdentity identity; + + /* + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * ETag of the resource. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Email address from which the notification will be sent. + */ + @JsonProperty(value = "properties.notificationSenderEmail") + private String notificationSenderEmail; + + /* + * The current provisioning state of the API Management service which can + * be one of the following: + * Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The provisioning state of the API Management service, which is targeted + * by the long running operation started on the service. + */ + @JsonProperty(value = "properties.targetProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String targetProvisioningState; + + /* + * Creation UTC date of the API Management service.The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + */ + @JsonProperty(value = "properties.createdAtUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAtUtc; + + /* + * Gateway URL of the API Management service. + */ + @JsonProperty(value = "properties.gatewayUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayUrl; + + /* + * Gateway URL of the API Management service in the Default Region. + */ + @JsonProperty(value = "properties.gatewayRegionalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayRegionalUrl; + + /* + * Publisher portal endpoint Url of the API Management service. + */ + @JsonProperty(value = "properties.portalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String portalUrl; + + /* + * Management API endpoint URL of the API Management service. + */ + @JsonProperty(value = "properties.managementApiUrl", access = JsonProperty.Access.WRITE_ONLY) + private String managementApiUrl; + + /* + * SCM endpoint URL of the API Management service. + */ + @JsonProperty(value = "properties.scmUrl", access = JsonProperty.Access.WRITE_ONLY) + private String scmUrl; + + /* + * DEveloper Portal endpoint URL of the API Management service. + */ + @JsonProperty(value = "properties.developerPortalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String developerPortalUrl; + + /* + * Custom hostname configuration of the API Management service. + */ + @JsonProperty(value = "properties.hostnameConfigurations") + private List hostnameConfigurations; + + /* + * Public Static Load Balanced IP addresses of the API Management service + * in Primary region. Available only for Basic, Standard, Premium and + * Isolated SKU. + */ + @JsonProperty(value = "properties.publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * Private Static Load Balanced IP addresses of the API Management service + * in Primary region which is deployed in an Internal Virtual Network. + * Available only for Basic, Standard, Premium and Isolated SKU. + */ + @JsonProperty(value = "properties.privateIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List privateIpAddresses; + + /* + * Virtual network configuration of the API Management service. + */ + @JsonProperty(value = "properties.virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /* + * Additional datacenter locations of the API Management service. + */ + @JsonProperty(value = "properties.additionalLocations") + private List additionalLocations; + + /* + * Custom properties of the API Management service.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + * will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, + * 1.1 and 1.2).
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + * can be used to disable just TLS 1.1.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + * can be used to disable TLS 1.0 on an API Management service.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + * can be used to disable just TLS 1.1 for communications with + * backends.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + * can be used to disable TLS 1.0 for communications with + * backends.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + * can be used to enable HTTP2 protocol on an API Management + * service.
Not specifying any of these properties on PATCH operation + * will reset omitted properties' values to their defaults. For all the + * settings except Http2 the default value is `True` if the service was + * created on or before April 1st 2018 and `False` otherwise. Http2 + * setting's default value is `False`.

You can disable any of next + * ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + * TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + * TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be + * disabled since they are required by Azure CloudService internal + * components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 + */ + @JsonProperty(value = "properties.customProperties") + private Map customProperties; + + /* + * List of Certificates that need to be installed in the API Management + * service. Max supported certificates that can be installed is 10. + */ + @JsonProperty(value = "properties.certificates") + private List certificates; + + /* + * Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the + * gateway. This also enables the ability to authenticate the certificate + * in the policy on the gateway. + */ + @JsonProperty(value = "properties.enableClientCertificate") + private Boolean enableClientCertificate; + + /* + * Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + */ + @JsonProperty(value = "properties.disableGateway") + private Boolean disableGateway; + + /* + * The type of VPN in which API Management service needs to be configured + * in. None (Default Value) means the API Management service is not part of + * any Virtual Network, External means the API Management deployment is set + * up inside a Virtual Network having an Internet Facing Endpoint, and + * Internal means that API Management deployment is setup inside a Virtual + * Network having an Intranet Facing Endpoint only. + */ + @JsonProperty(value = "properties.virtualNetworkType") + private VirtualNetworkType virtualNetworkType; + + /* + * Control Plane Apis version constraint for the API Management service. + */ + @JsonProperty(value = "properties.apiVersionConstraint") + private ApiVersionConstraint apiVersionConstraint; + + /* + * Undelete Api Management Service if it was previously soft-deleted. If + * this flag is specified and set to True all other properties will be + * ignored. + */ + @JsonProperty(value = "properties.restore") + private Boolean restore; + + /* + * Publisher email. + */ + @JsonProperty(value = "properties.publisherEmail", required = true) + private String publisherEmail; + + /* + * Publisher name. + */ + @JsonProperty(value = "properties.publisherName", required = true) + private String publisherName; + + /** + * Get the sku property: SKU properties of the API Management service. + * + * @return the sku value. + */ + public ApiManagementServiceSkuProperties sku() { + return this.sku; + } + + /** + * Set the sku property: SKU properties of the API Management service. + * + * @param sku the sku value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withSku(ApiManagementServiceSkuProperties sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Managed service identity of the Api Management service. + * + * @return the identity value. + */ + public ApiManagementServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity of the Api Management service. + * + * @param identity the identity value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withIdentity(ApiManagementServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Resource location. + * + * @param location the location value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the etag property: ETag of the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @return the notificationSenderEmail value. + */ + public String notificationSenderEmail() { + return this.notificationSenderEmail; + } + + /** + * Set the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @param notificationSenderEmail the notificationSenderEmail value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withNotificationSenderEmail(String notificationSenderEmail) { + this.notificationSenderEmail = notificationSenderEmail; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state of the API Management service which can be one + * of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the targetProvisioningState property: The provisioning state of the API Management service, which is targeted + * by the long running operation started on the service. + * + * @return the targetProvisioningState value. + */ + public String targetProvisioningState() { + return this.targetProvisioningState; + } + + /** + * Get the createdAtUtc property: Creation UTC date of the API Management service.The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the createdAtUtc value. + */ + public OffsetDateTime createdAtUtc() { + return this.createdAtUtc; + } + + /** + * Get the gatewayUrl property: Gateway URL of the API Management service. + * + * @return the gatewayUrl value. + */ + public String gatewayUrl() { + return this.gatewayUrl; + } + + /** + * Get the gatewayRegionalUrl property: Gateway URL of the API Management service in the Default Region. + * + * @return the gatewayRegionalUrl value. + */ + public String gatewayRegionalUrl() { + return this.gatewayRegionalUrl; + } + + /** + * Get the portalUrl property: Publisher portal endpoint Url of the API Management service. + * + * @return the portalUrl value. + */ + public String portalUrl() { + return this.portalUrl; + } + + /** + * Get the managementApiUrl property: Management API endpoint URL of the API Management service. + * + * @return the managementApiUrl value. + */ + public String managementApiUrl() { + return this.managementApiUrl; + } + + /** + * Get the scmUrl property: SCM endpoint URL of the API Management service. + * + * @return the scmUrl value. + */ + public String scmUrl() { + return this.scmUrl; + } + + /** + * Get the developerPortalUrl property: DEveloper Portal endpoint URL of the API Management service. + * + * @return the developerPortalUrl value. + */ + public String developerPortalUrl() { + return this.developerPortalUrl; + } + + /** + * Get the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @return the hostnameConfigurations value. + */ + public List hostnameConfigurations() { + return this.hostnameConfigurations; + } + + /** + * Set the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @param hostnameConfigurations the hostnameConfigurations value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withHostnameConfigurations( + List hostnameConfigurations) { + this.hostnameConfigurations = hostnameConfigurations; + return this; + } + + /** + * Get the publicIpAddresses property: Public Static Load Balanced IP addresses of the API Management service in + * Primary region. Available only for Basic, Standard, Premium and Isolated SKU. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the privateIpAddresses property: Private Static Load Balanced IP addresses of the API Management service in + * Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and + * Isolated SKU. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Get the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @return the virtualNetworkConfiguration value. + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withVirtualNetworkConfiguration( + VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @return the additionalLocations value. + */ + public List additionalLocations() { + return this.additionalLocations; + } + + /** + * Set the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @param additionalLocations the additionalLocations value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withAdditionalLocations(List additionalLocations) { + this.additionalLocations = additionalLocations; + return this; + } + + /** + * Get the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @param customProperties the customProperties value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withCustomProperties(Map customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Get the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @param certificates the certificates value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @return the enableClientCertificate value. + */ + public Boolean enableClientCertificate() { + return this.enableClientCertificate; + } + + /** + * Set the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @param enableClientCertificate the enableClientCertificate value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withEnableClientCertificate(Boolean enableClientCertificate) { + this.enableClientCertificate = enableClientCertificate; + return this; + } + + /** + * Get the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @return the disableGateway value. + */ + public Boolean disableGateway() { + return this.disableGateway; + } + + /** + * Set the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @param disableGateway the disableGateway value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withDisableGateway(Boolean disableGateway) { + this.disableGateway = disableGateway; + return this; + } + + /** + * Get the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @return the virtualNetworkType value. + */ + public VirtualNetworkType virtualNetworkType() { + return this.virtualNetworkType; + } + + /** + * Set the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @param virtualNetworkType the virtualNetworkType value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withVirtualNetworkType(VirtualNetworkType virtualNetworkType) { + this.virtualNetworkType = virtualNetworkType; + return this; + } + + /** + * Get the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @return the apiVersionConstraint value. + */ + public ApiVersionConstraint apiVersionConstraint() { + return this.apiVersionConstraint; + } + + /** + * Set the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @param apiVersionConstraint the apiVersionConstraint value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint) { + this.apiVersionConstraint = apiVersionConstraint; + return this; + } + + /** + * Get the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @return the restore value. + */ + public Boolean restore() { + return this.restore; + } + + /** + * Set the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @param restore the restore value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withRestore(Boolean restore) { + this.restore = restore; + return this; + } + + /** + * Get the publisherEmail property: Publisher email. + * + * @return the publisherEmail value. + */ + public String publisherEmail() { + return this.publisherEmail; + } + + /** + * Set the publisherEmail property: Publisher email. + * + * @param publisherEmail the publisherEmail value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withPublisherEmail(String publisherEmail) { + this.publisherEmail = publisherEmail; + return this; + } + + /** + * Get the publisherName property: Publisher name. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Set the publisherName property: Publisher name. + * + * @param publisherName the publisherName value to set. + * @return the ApiManagementServiceResourceInner object itself. + */ + public ApiManagementServiceResourceInner withPublisherName(String publisherName) { + this.publisherName = publisherName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sku in model ApiManagementServiceResourceInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model ApiManagementServiceResourceInner")); + } + if (hostnameConfigurations() != null) { + hostnameConfigurations().forEach(e -> e.validate()); + } + if (virtualNetworkConfiguration() != null) { + virtualNetworkConfiguration().validate(); + } + if (additionalLocations() != null) { + additionalLocations().forEach(e -> e.validate()); + } + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (apiVersionConstraint() != null) { + apiVersionConstraint().validate(); + } + if (publisherEmail() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisherEmail in model ApiManagementServiceResourceInner")); + } + if (publisherName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisherName in model ApiManagementServiceResourceInner")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementSkuInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementSkuInner.java new file mode 100644 index 0000000000000..702c4dbc8d361 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiManagementSkuInner.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuCapabilities; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuCapacity; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuCosts; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuLocationInfo; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available ApiManagement SKU. */ +@Immutable +public final class ApiManagementSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuInner.class); + + /* + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Specifies the tier of virtual machines in a scale set.

+ * Possible Values:

**Standard**

**Basic** + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /* + * The Size of the SKU. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /* + * The Family of this particular SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * The Kind of resources that are supported in this SKU. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Specifies the number of virtual machines in the scale set. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ApiManagementSkuCapacity capacity; + + /* + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * A list of locations and availability zones in those locations where the + * SKU is available. + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * The api versions that support this SKU. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /* + * Metadata for retrieving price info. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /* + * A name value pair to describe the capability. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the size property: The Size of the SKU. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The Family of this particular SKU. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + public ApiManagementSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiReleaseContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiReleaseContractInner.java new file mode 100644 index 0000000000000..6144246b771f1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiReleaseContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** ApiRelease details. */ +@JsonFlatten +@Fluent +public class ApiReleaseContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleaseContractInner.class); + + /* + * Identifier of the API the release belongs to. + */ + @JsonProperty(value = "properties.apiId") + private String apiId; + + /* + * The time the API was released. The date conforms to the following + * format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + */ + @JsonProperty(value = "properties.createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The time the API release was updated. + */ + @JsonProperty(value = "properties.updatedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedDateTime; + + /* + * Release Notes + */ + @JsonProperty(value = "properties.notes") + private String notes; + + /** + * Get the apiId property: Identifier of the API the release belongs to. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: Identifier of the API the release belongs to. + * + * @param apiId the apiId value to set. + * @return the ApiReleaseContractInner object itself. + */ + public ApiReleaseContractInner withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Get the createdDateTime property: The time the API was released. The date conforms to the following format: + * yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the updatedDateTime property: The time the API release was updated. + * + * @return the updatedDateTime value. + */ + public OffsetDateTime updatedDateTime() { + return this.updatedDateTime; + } + + /** + * Get the notes property: Release Notes. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Set the notes property: Release Notes. + * + * @param notes the notes value to set. + * @return the ApiReleaseContractInner object itself. + */ + public ApiReleaseContractInner withNotes(String notes) { + this.notes = notes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiRevisionContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiRevisionContractInner.java new file mode 100644 index 0000000000000..76bb08e9489f3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiRevisionContractInner.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; +import java.time.OffsetDateTime; + +/** Summary of revision metadata. */ +@Immutable +public final class ApiRevisionContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiRevisionContractInner.class); + + /* + * Identifier of the API Revision. + */ + @JsonProperty(value = "apiId", access = JsonProperty.Access.WRITE_ONLY) + private String apiId; + + /* + * Revision number of API. + */ + @JsonProperty(value = "apiRevision", access = JsonProperty.Access.WRITE_ONLY) + private String apiRevision; + + /* + * The time the API Revision was created. The date conforms to the + * following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + * standard. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The time the API Revision were updated. The date conforms to the + * following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + * standard. + */ + @JsonProperty(value = "updatedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedDateTime; + + /* + * Description of the API Revision. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Gateway URL for accessing the non-current API Revision. + */ + @JsonProperty(value = "privateUrl", access = JsonProperty.Access.WRITE_ONLY) + private String privateUrl; + + /* + * Indicates if API revision is the current api revision. + */ + @JsonProperty(value = "isOnline", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOnline; + + /* + * Indicates if API revision is accessible via the gateway. + */ + @JsonProperty(value = "isCurrent", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCurrent; + + /** + * Get the apiId property: Identifier of the API Revision. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Get the apiRevision property: Revision number of API. + * + * @return the apiRevision value. + */ + public String apiRevision() { + return this.apiRevision; + } + + /** + * Get the createdDateTime property: The time the API Revision was created. The date conforms to the following + * format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the updatedDateTime property: The time the API Revision were updated. The date conforms to the following + * format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the updatedDateTime value. + */ + public OffsetDateTime updatedDateTime() { + return this.updatedDateTime; + } + + /** + * Get the description property: Description of the API Revision. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the privateUrl property: Gateway URL for accessing the non-current API Revision. + * + * @return the privateUrl value. + */ + public String privateUrl() { + return this.privateUrl; + } + + /** + * Get the isOnline property: Indicates if API revision is the current api revision. + * + * @return the isOnline value. + */ + public Boolean isOnline() { + return this.isOnline; + } + + /** + * Get the isCurrent property: Indicates if API revision is accessible via the gateway. + * + * @return the isCurrent value. + */ + public Boolean isCurrent() { + return this.isCurrent; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiVersionSetContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiVersionSetContractInner.java new file mode 100644 index 0000000000000..5ddd69de6c359 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ApiVersionSetContractInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.VersioningScheme; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Api Version Set Contract details. */ +@JsonFlatten +@Fluent +public class ApiVersionSetContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetContractInner.class); + + /* + * Description of API Version Set. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Name of query parameter that indicates the API Version if + * versioningScheme is set to `query`. + */ + @JsonProperty(value = "properties.versionQueryName") + private String versionQueryName; + + /* + * Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + */ + @JsonProperty(value = "properties.versionHeaderName") + private String versionHeaderName; + + /* + * Name of API Version Set + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * An value that determines where the API Version identifier will be + * located in a HTTP request. + */ + @JsonProperty(value = "properties.versioningScheme") + private VersioningScheme versioningScheme; + + /** + * Get the description property: Description of API Version Set. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of API Version Set. + * + * @param description the description value to set. + * @return the ApiVersionSetContractInner object itself. + */ + public ApiVersionSetContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @return the versionQueryName value. + */ + public String versionQueryName() { + return this.versionQueryName; + } + + /** + * Set the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @param versionQueryName the versionQueryName value to set. + * @return the ApiVersionSetContractInner object itself. + */ + public ApiVersionSetContractInner withVersionQueryName(String versionQueryName) { + this.versionQueryName = versionQueryName; + return this; + } + + /** + * Get the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @return the versionHeaderName value. + */ + public String versionHeaderName() { + return this.versionHeaderName; + } + + /** + * Set the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @param versionHeaderName the versionHeaderName value to set. + * @return the ApiVersionSetContractInner object itself. + */ + public ApiVersionSetContractInner withVersionHeaderName(String versionHeaderName) { + this.versionHeaderName = versionHeaderName; + return this; + } + + /** + * Get the displayName property: Name of API Version Set. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Name of API Version Set. + * + * @param displayName the displayName value to set. + * @return the ApiVersionSetContractInner object itself. + */ + public ApiVersionSetContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @return the versioningScheme value. + */ + public VersioningScheme versioningScheme() { + return this.versioningScheme; + } + + /** + * Set the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @param versioningScheme the versioningScheme value to set. + * @return the ApiVersionSetContractInner object itself. + */ + public ApiVersionSetContractInner withVersioningScheme(VersioningScheme versioningScheme) { + this.versioningScheme = versioningScheme; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerContractInner.java new file mode 100644 index 0000000000000..8ebdc359ec152 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerContractInner.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.AuthorizationMethod; +import com.azure.resourcemanager.apimanagement.models.BearerTokenSendingMethod; +import com.azure.resourcemanager.apimanagement.models.ClientAuthenticationMethod; +import com.azure.resourcemanager.apimanagement.models.GrantType; +import com.azure.resourcemanager.apimanagement.models.TokenBodyParameterContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** External OAuth authorization server settings. */ +@JsonFlatten +@Fluent +public class AuthorizationServerContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerContractInner.class); + + /* + * Description of the authorization server. Can contain HTML formatting + * tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + */ + @JsonProperty(value = "properties.authorizationMethods") + private List authorizationMethods; + + /* + * Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body + * is specified, client credentials and other parameters are passed within + * the request body in the application/x-www-form-urlencoded format. + */ + @JsonProperty(value = "properties.clientAuthenticationMethod") + private List clientAuthenticationMethod; + + /* + * Additional parameters required by the token endpoint of this + * authorization server represented as an array of JSON objects with name + * and value string properties, i.e. {"name" : "name value", "value": "a + * value"}. + */ + @JsonProperty(value = "properties.tokenBodyParameters") + private List tokenBodyParameters; + + /* + * OAuth token endpoint. Contains absolute URI to entity being referenced. + */ + @JsonProperty(value = "properties.tokenEndpoint") + private String tokenEndpoint; + + /* + * If true, authorization server will include state parameter from the + * authorization request to its response. Client may use state parameter to + * raise protocol security. + */ + @JsonProperty(value = "properties.supportState") + private Boolean supportState; + + /* + * Access token scope that is going to be requested by default. Can be + * overridden at the API level. Should be provided in the form of a string + * containing space-delimited values. + */ + @JsonProperty(value = "properties.defaultScope") + private String defaultScope; + + /* + * Specifies the mechanism by which access token is passed to the API. + */ + @JsonProperty(value = "properties.bearerTokenSendingMethods") + private List bearerTokenSendingMethods; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + */ + @JsonProperty(value = "properties.resourceOwnerUsername") + private String resourceOwnerUsername; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + */ + @JsonProperty(value = "properties.resourceOwnerPassword") + private String resourceOwnerPassword; + + /* + * User-friendly authorization server name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Optional reference to a page where client or app registration for this + * authorization server is performed. Contains absolute URL to entity being + * referenced. + */ + @JsonProperty(value = "properties.clientRegistrationEndpoint") + private String clientRegistrationEndpoint; + + /* + * OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + */ + @JsonProperty(value = "properties.authorizationEndpoint") + private String authorizationEndpoint; + + /* + * Form of an authorization grant, which the client uses to request the + * access token. + */ + @JsonProperty(value = "properties.grantTypes") + private List grantTypes; + + /* + * Client or app id registered with this authorization server. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client or app secret registered with this authorization server. This + * property will not be filled on 'GET' operations! Use '/listSecrets' POST + * request to get the value. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @param description the description value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @return the authorizationMethods value. + */ + public List authorizationMethods() { + return this.authorizationMethods; + } + + /** + * Set the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @param authorizationMethods the authorizationMethods value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withAuthorizationMethods(List authorizationMethods) { + this.authorizationMethods = authorizationMethods; + return this; + } + + /** + * Get the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @return the clientAuthenticationMethod value. + */ + public List clientAuthenticationMethod() { + return this.clientAuthenticationMethod; + } + + /** + * Set the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @param clientAuthenticationMethod the clientAuthenticationMethod value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withClientAuthenticationMethod( + List clientAuthenticationMethod) { + this.clientAuthenticationMethod = clientAuthenticationMethod; + return this; + } + + /** + * Get the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @return the tokenBodyParameters value. + */ + public List tokenBodyParameters() { + return this.tokenBodyParameters; + } + + /** + * Set the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @param tokenBodyParameters the tokenBodyParameters value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withTokenBodyParameters( + List tokenBodyParameters) { + this.tokenBodyParameters = tokenBodyParameters; + return this; + } + + /** + * Get the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @return the supportState value. + */ + public Boolean supportState() { + return this.supportState; + } + + /** + * Set the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @param supportState the supportState value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withSupportState(Boolean supportState) { + this.supportState = supportState; + return this; + } + + /** + * Get the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @return the defaultScope value. + */ + public String defaultScope() { + return this.defaultScope; + } + + /** + * Set the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @param defaultScope the defaultScope value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withDefaultScope(String defaultScope) { + this.defaultScope = defaultScope; + return this; + } + + /** + * Get the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @return the bearerTokenSendingMethods value. + */ + public List bearerTokenSendingMethods() { + return this.bearerTokenSendingMethods; + } + + /** + * Set the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @param bearerTokenSendingMethods the bearerTokenSendingMethods value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + this.bearerTokenSendingMethods = bearerTokenSendingMethods; + return this; + } + + /** + * Get the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @return the resourceOwnerUsername value. + */ + public String resourceOwnerUsername() { + return this.resourceOwnerUsername; + } + + /** + * Set the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @param resourceOwnerUsername the resourceOwnerUsername value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withResourceOwnerUsername(String resourceOwnerUsername) { + this.resourceOwnerUsername = resourceOwnerUsername; + return this; + } + + /** + * Get the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @return the resourceOwnerPassword value. + */ + public String resourceOwnerPassword() { + return this.resourceOwnerPassword; + } + + /** + * Set the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @param resourceOwnerPassword the resourceOwnerPassword value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withResourceOwnerPassword(String resourceOwnerPassword) { + this.resourceOwnerPassword = resourceOwnerPassword; + return this; + } + + /** + * Get the displayName property: User-friendly authorization server name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User-friendly authorization server name. + * + * @param displayName the displayName value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @return the clientRegistrationEndpoint value. + */ + public String clientRegistrationEndpoint() { + return this.clientRegistrationEndpoint; + } + + /** + * Set the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @param clientRegistrationEndpoint the clientRegistrationEndpoint value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withClientRegistrationEndpoint(String clientRegistrationEndpoint) { + this.clientRegistrationEndpoint = clientRegistrationEndpoint; + return this; + } + + /** + * Get the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @return the grantTypes value. + */ + public List grantTypes() { + return this.grantTypes; + } + + /** + * Set the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @param grantTypes the grantTypes value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withGrantTypes(List grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + /** + * Get the clientId property: Client or app id registered with this authorization server. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client or app id registered with this authorization server. + * + * @param clientId the clientId value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @param clientSecret the clientSecret value to set. + * @return the AuthorizationServerContractInner object itself. + */ + public AuthorizationServerContractInner withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tokenBodyParameters() != null) { + tokenBodyParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerSecretsContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerSecretsContractInner.java new file mode 100644 index 0000000000000..5264dbd17d39f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/AuthorizationServerSecretsContractInner.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.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; + +/** OAuth Server Secrets Contract. */ +@Fluent +public final class AuthorizationServerSecretsContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerSecretsContractInner.class); + + /* + * oAuth Authorization Server Secrets. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + */ + @JsonProperty(value = "resourceOwnerUsername") + private String resourceOwnerUsername; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + */ + @JsonProperty(value = "resourceOwnerPassword") + private String resourceOwnerPassword; + + /** + * Get the clientSecret property: oAuth Authorization Server Secrets. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: oAuth Authorization Server Secrets. + * + * @param clientSecret the clientSecret value to set. + * @return the AuthorizationServerSecretsContractInner object itself. + */ + public AuthorizationServerSecretsContractInner withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @return the resourceOwnerUsername value. + */ + public String resourceOwnerUsername() { + return this.resourceOwnerUsername; + } + + /** + * Set the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @param resourceOwnerUsername the resourceOwnerUsername value to set. + * @return the AuthorizationServerSecretsContractInner object itself. + */ + public AuthorizationServerSecretsContractInner withResourceOwnerUsername(String resourceOwnerUsername) { + this.resourceOwnerUsername = resourceOwnerUsername; + return this; + } + + /** + * Get the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @return the resourceOwnerPassword value. + */ + public String resourceOwnerPassword() { + return this.resourceOwnerPassword; + } + + /** + * Set the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @param resourceOwnerPassword the resourceOwnerPassword value to set. + * @return the AuthorizationServerSecretsContractInner object itself. + */ + public AuthorizationServerSecretsContractInner withResourceOwnerPassword(String resourceOwnerPassword) { + this.resourceOwnerPassword = resourceOwnerPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/BackendContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/BackendContractInner.java new file mode 100644 index 0000000000000..b8644d54cb646 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/BackendContractInner.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.BackendCredentialsContract; +import com.azure.resourcemanager.apimanagement.models.BackendProperties; +import com.azure.resourcemanager.apimanagement.models.BackendProtocol; +import com.azure.resourcemanager.apimanagement.models.BackendProxyContract; +import com.azure.resourcemanager.apimanagement.models.BackendTlsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backend details. */ +@JsonFlatten +@Fluent +public class BackendContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendContractInner.class); + + /* + * Backend Title. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Backend Description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Management Uri of the Resource in External System. This url can be the + * Arm Resource Id of Logic Apps, Function Apps or Api Apps. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /* + * Backend Properties contract + */ + @JsonProperty(value = "properties.properties") + private BackendProperties properties; + + /* + * Backend Credentials Contract Properties + */ + @JsonProperty(value = "properties.credentials") + private BackendCredentialsContract credentials; + + /* + * Backend Proxy Contract Properties + */ + @JsonProperty(value = "properties.proxy") + private BackendProxyContract proxy; + + /* + * Backend TLS Properties + */ + @JsonProperty(value = "properties.tls") + private BackendTlsProperties tls; + + /* + * Runtime Url of the Backend. + */ + @JsonProperty(value = "properties.url") + private String url; + + /* + * Backend communication protocol. + */ + @JsonProperty(value = "properties.protocol") + private BackendProtocol protocol; + + /** + * Get the title property: Backend Title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Backend Title. + * + * @param title the title value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Backend Description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Backend Description. + * + * @param description the description value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @param resourceId the resourceId value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the properties property: Backend Properties contract. + * + * @return the properties value. + */ + public BackendProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Backend Properties contract. + * + * @param properties the properties value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withProperties(BackendProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the credentials property: Backend Credentials Contract Properties. + * + * @return the credentials value. + */ + public BackendCredentialsContract credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Backend Credentials Contract Properties. + * + * @param credentials the credentials value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withCredentials(BackendCredentialsContract credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the proxy property: Backend Proxy Contract Properties. + * + * @return the proxy value. + */ + public BackendProxyContract proxy() { + return this.proxy; + } + + /** + * Set the proxy property: Backend Proxy Contract Properties. + * + * @param proxy the proxy value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withProxy(BackendProxyContract proxy) { + this.proxy = proxy; + return this; + } + + /** + * Get the tls property: Backend TLS Properties. + * + * @return the tls value. + */ + public BackendTlsProperties tls() { + return this.tls; + } + + /** + * Set the tls property: Backend TLS Properties. + * + * @param tls the tls value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withTls(BackendTlsProperties tls) { + this.tls = tls; + return this; + } + + /** + * Get the url property: Runtime Url of the Backend. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Runtime Url of the Backend. + * + * @param url the url value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the protocol property: Backend communication protocol. + * + * @return the protocol value. + */ + public BackendProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Backend communication protocol. + * + * @param protocol the protocol value to set. + * @return the BackendContractInner object itself. + */ + public BackendContractInner withProtocol(BackendProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + if (proxy() != null) { + proxy().validate(); + } + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CacheContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CacheContractInner.java new file mode 100644 index 0000000000000..7c4390ac6f623 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CacheContractInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cache details. */ +@JsonFlatten +@Fluent +public class CacheContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheContractInner.class); + + /* + * Cache description + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Runtime connection string to cache + */ + @JsonProperty(value = "properties.connectionString") + private String connectionString; + + /* + * Location identifier to use cache from (should be either 'default' or + * valid Azure region identifier) + */ + @JsonProperty(value = "properties.useFromLocation") + private String useFromLocation; + + /* + * Original uri of entity in external system cache points to + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the description property: Cache description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Cache description. + * + * @param description the description value to set. + * @return the CacheContractInner object itself. + */ + public CacheContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the connectionString property: Runtime connection string to cache. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: Runtime connection string to cache. + * + * @param connectionString the connectionString value to set. + * @return the CacheContractInner object itself. + */ + public CacheContractInner withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the useFromLocation property: Location identifier to use cache from (should be either 'default' or valid + * Azure region identifier). + * + * @return the useFromLocation value. + */ + public String useFromLocation() { + return this.useFromLocation; + } + + /** + * Set the useFromLocation property: Location identifier to use cache from (should be either 'default' or valid + * Azure region identifier). + * + * @param useFromLocation the useFromLocation value to set. + * @return the CacheContractInner object itself. + */ + public CacheContractInner withUseFromLocation(String useFromLocation) { + this.useFromLocation = useFromLocation; + return this; + } + + /** + * Get the resourceId property: Original uri of entity in external system cache points to. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Original uri of entity in external system cache points to. + * + * @param resourceId the resourceId value to set. + * @return the CacheContractInner object itself. + */ + public CacheContractInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CertificateContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CertificateContractInner.java new file mode 100644 index 0000000000000..1471580f31ba8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/CertificateContractInner.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.apimanagement.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.apimanagement.models.KeyVaultContractProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Certificate details. */ +@JsonFlatten +@Fluent +public class CertificateContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateContractInner.class); + + /* + * Subject attribute of the certificate. + */ + @JsonProperty(value = "properties.subject") + private String subject; + + /* + * Thumbprint of the certificate. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /* + * Expiration date of the certificate. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.expirationDate") + private OffsetDateTime expirationDate; + + /* + * KeyVault location details of the certificate. + */ + @JsonProperty(value = "properties.keyVault") + private KeyVaultContractProperties keyVault; + + /** + * Get the subject property: Subject attribute of the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject attribute of the certificate. + * + * @param subject the subject value to set. + * @return the CertificateContractInner object itself. + */ + public CertificateContractInner withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the thumbprint property: Thumbprint of the certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Thumbprint of the certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the CertificateContractInner object itself. + */ + public CertificateContractInner withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the expirationDate property: Expiration date of the certificate. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: Expiration date of the certificate. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param expirationDate the expirationDate value to set. + * @return the CertificateContractInner object itself. + */ + public CertificateContractInner withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the certificate. + * + * @return the keyVault value. + */ + public KeyVaultContractProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the certificate. + * + * @param keyVault the keyVault value to set. + * @return the CertificateContractInner object itself. + */ + public CertificateContractInner withKeyVault(KeyVaultContractProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ClientSecretContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ClientSecretContractInner.java new file mode 100644 index 0000000000000..d744e54b3bb95 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ClientSecretContractInner.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.apimanagement.fluent.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; + +/** Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. */ +@Fluent +public final class ClientSecretContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientSecretContractInner.class); + + /* + * Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Get the clientSecret property: Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + * + * @param clientSecret the clientSecret value to set. + * @return the ClientSecretContractInner object itself. + */ + public ClientSecretContractInner withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentItemContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentItemContractInner.java new file mode 100644 index 0000000000000..37c1eb40bdb2b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentItemContractInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Content type contract details. */ +@Fluent +public final class ContentItemContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentItemContractInner.class); + + /* + * Properties of the content item. + */ + @JsonProperty(value = "properties") + private Map properties; + + /** + * Get the properties property: Properties of the content item. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the content item. + * + * @param properties the properties value to set. + * @return the ContentItemContractInner object itself. + */ + public ContentItemContractInner withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentTypeContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentTypeContractInner.java new file mode 100644 index 0000000000000..1e96f24fdfe06 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ContentTypeContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Content type contract details. */ +@JsonFlatten +@Fluent +public class ContentTypeContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentTypeContractInner.class); + + /* + * Content type identifier + */ + @JsonProperty(value = "properties.id") + private String idPropertiesId; + + /* + * Content type name. Must be 1 to 250 characters long. + */ + @JsonProperty(value = "properties.name") + private String namePropertiesName; + + /* + * Content type description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Content type schema. + */ + @JsonProperty(value = "properties.schema") + private Object schema; + + /* + * Content type version. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Get the idPropertiesId property: Content type identifier. + * + * @return the idPropertiesId value. + */ + public String idPropertiesId() { + return this.idPropertiesId; + } + + /** + * Set the idPropertiesId property: Content type identifier. + * + * @param idPropertiesId the idPropertiesId value to set. + * @return the ContentTypeContractInner object itself. + */ + public ContentTypeContractInner withIdPropertiesId(String idPropertiesId) { + this.idPropertiesId = idPropertiesId; + return this; + } + + /** + * Get the namePropertiesName property: Content type name. Must be 1 to 250 characters long. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.namePropertiesName; + } + + /** + * Set the namePropertiesName property: Content type name. Must be 1 to 250 characters long. + * + * @param namePropertiesName the namePropertiesName value to set. + * @return the ContentTypeContractInner object itself. + */ + public ContentTypeContractInner withNamePropertiesName(String namePropertiesName) { + this.namePropertiesName = namePropertiesName; + return this; + } + + /** + * Get the description property: Content type description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Content type description. + * + * @param description the description value to set. + * @return the ContentTypeContractInner object itself. + */ + public ContentTypeContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the schema property: Content type schema. + * + * @return the schema value. + */ + public Object schema() { + return this.schema; + } + + /** + * Set the schema property: Content type schema. + * + * @param schema the schema value to set. + * @return the ContentTypeContractInner object itself. + */ + public ContentTypeContractInner withSchema(Object schema) { + this.schema = schema; + return this; + } + + /** + * Get the version property: Content type version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Content type version. + * + * @param version the version value to set. + * @return the ContentTypeContractInner object itself. + */ + public ContentTypeContractInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DeletedServiceContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DeletedServiceContractInner.java new file mode 100644 index 0000000000000..c28e61e91dc94 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DeletedServiceContractInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Deleted Api Management Service information. */ +@JsonFlatten +@Fluent +public class DeletedServiceContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedServiceContractInner.class); + + /* + * Api Management Service Master Location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Fully-qualified API Management Service Resource ID + */ + @JsonProperty(value = "properties.serviceId") + private String serviceId; + + /* + * UTC Date and Time when the service will be automatically purged. The + * date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + * by the ISO 8601 standard. + */ + @JsonProperty(value = "properties.scheduledPurgeDate") + private OffsetDateTime scheduledPurgeDate; + + /* + * UTC Timestamp when the service was soft-deleted. The date conforms to + * the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 + * standard. + */ + @JsonProperty(value = "properties.deletionDate") + private OffsetDateTime deletionDate; + + /** + * Get the location property: Api Management Service Master Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the serviceId property: Fully-qualified API Management Service Resource ID. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: Fully-qualified API Management Service Resource ID. + * + * @param serviceId the serviceId value to set. + * @return the DeletedServiceContractInner object itself. + */ + public DeletedServiceContractInner withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Get the scheduledPurgeDate property: UTC Date and Time when the service will be automatically purged. The date + * conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the scheduledPurgeDate value. + */ + public OffsetDateTime scheduledPurgeDate() { + return this.scheduledPurgeDate; + } + + /** + * Set the scheduledPurgeDate property: UTC Date and Time when the service will be automatically purged. The date + * conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @param scheduledPurgeDate the scheduledPurgeDate value to set. + * @return the DeletedServiceContractInner object itself. + */ + public DeletedServiceContractInner withScheduledPurgeDate(OffsetDateTime scheduledPurgeDate) { + this.scheduledPurgeDate = scheduledPurgeDate; + return this; + } + + /** + * Get the deletionDate property: UTC Timestamp when the service was soft-deleted. The date conforms to the + * following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the deletionDate value. + */ + public OffsetDateTime deletionDate() { + return this.deletionDate; + } + + /** + * Set the deletionDate property: UTC Timestamp when the service was soft-deleted. The date conforms to the + * following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @param deletionDate the deletionDate value to set. + * @return the DeletedServiceContractInner object itself. + */ + public DeletedServiceContractInner withDeletionDate(OffsetDateTime deletionDate) { + this.deletionDate = deletionDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DiagnosticContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DiagnosticContractInner.java new file mode 100644 index 0000000000000..00dd4e6003083 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/DiagnosticContractInner.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.AlwaysLog; +import com.azure.resourcemanager.apimanagement.models.HttpCorrelationProtocol; +import com.azure.resourcemanager.apimanagement.models.OperationNameFormat; +import com.azure.resourcemanager.apimanagement.models.PipelineDiagnosticSettings; +import com.azure.resourcemanager.apimanagement.models.SamplingSettings; +import com.azure.resourcemanager.apimanagement.models.Verbosity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Diagnostic details. */ +@JsonFlatten +@Fluent +public class DiagnosticContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticContractInner.class); + + /* + * Specifies for what type of messages sampling settings should not apply. + */ + @JsonProperty(value = "properties.alwaysLog") + private AlwaysLog alwaysLog; + + /* + * Resource Id of a target logger. + */ + @JsonProperty(value = "properties.loggerId") + private String loggerId; + + /* + * Sampling settings for Diagnostic. + */ + @JsonProperty(value = "properties.sampling") + private SamplingSettings sampling; + + /* + * Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + */ + @JsonProperty(value = "properties.frontend") + private PipelineDiagnosticSettings frontend; + + /* + * Diagnostic settings for incoming/outgoing HTTP messages to the Backend + */ + @JsonProperty(value = "properties.backend") + private PipelineDiagnosticSettings backend; + + /* + * Log the ClientIP. Default is false. + */ + @JsonProperty(value = "properties.logClientIp") + private Boolean logClientIp; + + /* + * Sets correlation protocol to use for Application Insights diagnostics. + */ + @JsonProperty(value = "properties.httpCorrelationProtocol") + private HttpCorrelationProtocol httpCorrelationProtocol; + + /* + * The verbosity level applied to traces emitted by trace policies. + */ + @JsonProperty(value = "properties.verbosity") + private Verbosity verbosity; + + /* + * The format of the Operation Name for Application Insights telemetries. + * Default is Name. + */ + @JsonProperty(value = "properties.operationNameFormat") + private OperationNameFormat operationNameFormat; + + /** + * Get the alwaysLog property: Specifies for what type of messages sampling settings should not apply. + * + * @return the alwaysLog value. + */ + public AlwaysLog alwaysLog() { + return this.alwaysLog; + } + + /** + * Set the alwaysLog property: Specifies for what type of messages sampling settings should not apply. + * + * @param alwaysLog the alwaysLog value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withAlwaysLog(AlwaysLog alwaysLog) { + this.alwaysLog = alwaysLog; + return this; + } + + /** + * Get the loggerId property: Resource Id of a target logger. + * + * @return the loggerId value. + */ + public String loggerId() { + return this.loggerId; + } + + /** + * Set the loggerId property: Resource Id of a target logger. + * + * @param loggerId the loggerId value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withLoggerId(String loggerId) { + this.loggerId = loggerId; + return this; + } + + /** + * Get the sampling property: Sampling settings for Diagnostic. + * + * @return the sampling value. + */ + public SamplingSettings sampling() { + return this.sampling; + } + + /** + * Set the sampling property: Sampling settings for Diagnostic. + * + * @param sampling the sampling value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withSampling(SamplingSettings sampling) { + this.sampling = sampling; + return this; + } + + /** + * Get the frontend property: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + * + * @return the frontend value. + */ + public PipelineDiagnosticSettings frontend() { + return this.frontend; + } + + /** + * Set the frontend property: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + * + * @param frontend the frontend value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withFrontend(PipelineDiagnosticSettings frontend) { + this.frontend = frontend; + return this; + } + + /** + * Get the backend property: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * + * @return the backend value. + */ + public PipelineDiagnosticSettings backend() { + return this.backend; + } + + /** + * Set the backend property: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * + * @param backend the backend value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withBackend(PipelineDiagnosticSettings backend) { + this.backend = backend; + return this; + } + + /** + * Get the logClientIp property: Log the ClientIP. Default is false. + * + * @return the logClientIp value. + */ + public Boolean logClientIp() { + return this.logClientIp; + } + + /** + * Set the logClientIp property: Log the ClientIP. Default is false. + * + * @param logClientIp the logClientIp value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withLogClientIp(Boolean logClientIp) { + this.logClientIp = logClientIp; + return this; + } + + /** + * Get the httpCorrelationProtocol property: Sets correlation protocol to use for Application Insights diagnostics. + * + * @return the httpCorrelationProtocol value. + */ + public HttpCorrelationProtocol httpCorrelationProtocol() { + return this.httpCorrelationProtocol; + } + + /** + * Set the httpCorrelationProtocol property: Sets correlation protocol to use for Application Insights diagnostics. + * + * @param httpCorrelationProtocol the httpCorrelationProtocol value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withHttpCorrelationProtocol(HttpCorrelationProtocol httpCorrelationProtocol) { + this.httpCorrelationProtocol = httpCorrelationProtocol; + return this; + } + + /** + * Get the verbosity property: The verbosity level applied to traces emitted by trace policies. + * + * @return the verbosity value. + */ + public Verbosity verbosity() { + return this.verbosity; + } + + /** + * Set the verbosity property: The verbosity level applied to traces emitted by trace policies. + * + * @param verbosity the verbosity value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withVerbosity(Verbosity verbosity) { + this.verbosity = verbosity; + return this; + } + + /** + * Get the operationNameFormat property: The format of the Operation Name for Application Insights telemetries. + * Default is Name. + * + * @return the operationNameFormat value. + */ + public OperationNameFormat operationNameFormat() { + return this.operationNameFormat; + } + + /** + * Set the operationNameFormat property: The format of the Operation Name for Application Insights telemetries. + * Default is Name. + * + * @param operationNameFormat the operationNameFormat value to set. + * @return the DiagnosticContractInner object itself. + */ + public DiagnosticContractInner withOperationNameFormat(OperationNameFormat operationNameFormat) { + this.operationNameFormat = operationNameFormat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sampling() != null) { + sampling().validate(); + } + if (frontend() != null) { + frontend().validate(); + } + if (backend() != null) { + backend().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/EmailTemplateContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/EmailTemplateContractInner.java new file mode 100644 index 0000000000000..6d1b0a4c0c439 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/EmailTemplateContractInner.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.apimanagement.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.apimanagement.models.EmailTemplateParametersContractProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Email Template details. */ +@JsonFlatten +@Fluent +public class EmailTemplateContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplateContractInner.class); + + /* + * Subject of the Template. + */ + @JsonProperty(value = "properties.subject") + private String subject; + + /* + * Email Template Body. This should be a valid XDocument + */ + @JsonProperty(value = "properties.body") + private String body; + + /* + * Title of the Template. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Description of the Email Template. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Whether the template is the default template provided by Api Management + * or has been edited. + */ + @JsonProperty(value = "properties.isDefault", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDefault; + + /* + * Email Template Parameter values. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * Get the subject property: Subject of the Template. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject of the Template. + * + * @param subject the subject value to set. + * @return the EmailTemplateContractInner object itself. + */ + public EmailTemplateContractInner withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the body property: Email Template Body. This should be a valid XDocument. + * + * @return the body value. + */ + public String body() { + return this.body; + } + + /** + * Set the body property: Email Template Body. This should be a valid XDocument. + * + * @param body the body value to set. + * @return the EmailTemplateContractInner object itself. + */ + public EmailTemplateContractInner withBody(String body) { + this.body = body; + return this; + } + + /** + * Get the title property: Title of the Template. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title of the Template. + * + * @param title the title value to set. + * @return the EmailTemplateContractInner object itself. + */ + public EmailTemplateContractInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Description of the Email Template. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the Email Template. + * + * @param description the description value to set. + * @return the EmailTemplateContractInner object itself. + */ + public EmailTemplateContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the isDefault property: Whether the template is the default template provided by Api Management or has been + * edited. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Get the parameters property: Email Template Parameter values. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Email Template Parameter values. + * + * @param parameters the parameters value to set. + * @return the EmailTemplateContractInner object itself. + */ + public EmailTemplateContractInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayCertificateAuthorityContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayCertificateAuthorityContractInner.java new file mode 100644 index 0000000000000..9022bb506bd63 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayCertificateAuthorityContractInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway certificate authority details. */ +@JsonFlatten +@Fluent +public class GatewayCertificateAuthorityContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthorityContractInner.class); + + /* + * Determines whether certificate authority is trusted. + */ + @JsonProperty(value = "properties.isTrusted") + private Boolean isTrusted; + + /** + * Get the isTrusted property: Determines whether certificate authority is trusted. + * + * @return the isTrusted value. + */ + public Boolean isTrusted() { + return this.isTrusted; + } + + /** + * Set the isTrusted property: Determines whether certificate authority is trusted. + * + * @param isTrusted the isTrusted value to set. + * @return the GatewayCertificateAuthorityContractInner object itself. + */ + public GatewayCertificateAuthorityContractInner withIsTrusted(Boolean isTrusted) { + this.isTrusted = isTrusted; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayContractInner.java new file mode 100644 index 0000000000000..4630bd5db1401 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayContractInner.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.apimanagement.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.apimanagement.models.ResourceLocationDataContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway details. */ +@JsonFlatten +@Fluent +public class GatewayContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayContractInner.class); + + /* + * Gateway location. + */ + @JsonProperty(value = "properties.locationData") + private ResourceLocationDataContract locationData; + + /* + * Gateway description + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Get the locationData property: Gateway location. + * + * @return the locationData value. + */ + public ResourceLocationDataContract locationData() { + return this.locationData; + } + + /** + * Set the locationData property: Gateway location. + * + * @param locationData the locationData value to set. + * @return the GatewayContractInner object itself. + */ + public GatewayContractInner withLocationData(ResourceLocationDataContract locationData) { + this.locationData = locationData; + return this; + } + + /** + * Get the description property: Gateway description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gateway description. + * + * @param description the description value to set. + * @return the GatewayContractInner object itself. + */ + public GatewayContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationData() != null) { + locationData().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayHostnameConfigurationContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayHostnameConfigurationContractInner.java new file mode 100644 index 0000000000000..88e63614c51c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayHostnameConfigurationContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway hostname configuration details. */ +@JsonFlatten +@Fluent +public class GatewayHostnameConfigurationContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationContractInner.class); + + /* + * Hostname value. Supports valid domain name, partial or full wildcard + */ + @JsonProperty(value = "properties.hostname") + private String hostname; + + /* + * Identifier of Certificate entity that will be used for TLS connection + * establishment + */ + @JsonProperty(value = "properties.certificateId") + private String certificateId; + + /* + * Determines whether gateway requests client certificate + */ + @JsonProperty(value = "properties.negotiateClientCertificate") + private Boolean negotiateClientCertificate; + + /* + * Specifies if TLS 1.0 is supported + */ + @JsonProperty(value = "properties.tls10Enabled") + private Boolean tls10Enabled; + + /* + * Specifies if TLS 1.1 is supported + */ + @JsonProperty(value = "properties.tls11Enabled") + private Boolean tls11Enabled; + + /* + * Specifies if HTTP/2.0 is supported + */ + @JsonProperty(value = "properties.http2Enabled") + private Boolean http2Enabled; + + /** + * Get the hostname property: Hostname value. Supports valid domain name, partial or full wildcard. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Hostname value. Supports valid domain name, partial or full wildcard. + * + * @param hostname the hostname value to set. + * @return the GatewayHostnameConfigurationContractInner object itself. + */ + public GatewayHostnameConfigurationContractInner withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the certificateId property: Identifier of Certificate entity that will be used for TLS connection + * establishment. + * + * @return the certificateId value. + */ + public String certificateId() { + return this.certificateId; + } + + /** + * Set the certificateId property: Identifier of Certificate entity that will be used for TLS connection + * establishment. + * + * @param certificateId the certificateId value to set. + * @return the GatewayHostnameConfigurationContractInner object itself. + */ + public GatewayHostnameConfigurationContractInner withCertificateId(String certificateId) { + this.certificateId = certificateId; + return this; + } + + /** + * Get the negotiateClientCertificate property: Determines whether gateway requests client certificate. + * + * @return the negotiateClientCertificate value. + */ + public Boolean negotiateClientCertificate() { + return this.negotiateClientCertificate; + } + + /** + * Set the negotiateClientCertificate property: Determines whether gateway requests client certificate. + * + * @param negotiateClientCertificate the negotiateClientCertificate value to set. + * @return the GatewayHostnameConfigurationContractInner object itself. + */ + public GatewayHostnameConfigurationContractInner withNegotiateClientCertificate( + Boolean negotiateClientCertificate) { + this.negotiateClientCertificate = negotiateClientCertificate; + return this; + } + + /** + * Get the tls10Enabled property: Specifies if TLS 1.0 is supported. + * + * @return the tls10Enabled value. + */ + public Boolean tls10Enabled() { + return this.tls10Enabled; + } + + /** + * Set the tls10Enabled property: Specifies if TLS 1.0 is supported. + * + * @param tls10Enabled the tls10Enabled value to set. + * @return the GatewayHostnameConfigurationContractInner object itself. + */ + public GatewayHostnameConfigurationContractInner withTls10Enabled(Boolean tls10Enabled) { + this.tls10Enabled = tls10Enabled; + return this; + } + + /** + * Get the tls11Enabled property: Specifies if TLS 1.1 is supported. + * + * @return the tls11Enabled value. + */ + public Boolean tls11Enabled() { + return this.tls11Enabled; + } + + /** + * Set the tls11Enabled property: Specifies if TLS 1.1 is supported. + * + * @param tls11Enabled the tls11Enabled value to set. + * @return the GatewayHostnameConfigurationContractInner object itself. + */ + public GatewayHostnameConfigurationContractInner withTls11Enabled(Boolean tls11Enabled) { + this.tls11Enabled = tls11Enabled; + return this; + } + + /** + * Get the http2Enabled property: Specifies if HTTP/2.0 is supported. + * + * @return the http2Enabled value. + */ + public Boolean http2Enabled() { + return this.http2Enabled; + } + + /** + * Set the http2Enabled property: Specifies if HTTP/2.0 is supported. + * + * @param http2Enabled the http2Enabled value to set. + * @return the GatewayHostnameConfigurationContractInner object itself. + */ + public GatewayHostnameConfigurationContractInner withHttp2Enabled(Boolean http2Enabled) { + this.http2Enabled = http2Enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayKeysContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayKeysContractInner.java new file mode 100644 index 0000000000000..6444faa3671aa --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayKeysContractInner.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.apimanagement.fluent.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; + +/** Gateway authentication keys. */ +@Fluent +public final class GatewayKeysContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayKeysContractInner.class); + + /* + * Primary gateway key. + */ + @JsonProperty(value = "primary") + private String primary; + + /* + * Secondary gateway key. + */ + @JsonProperty(value = "secondary") + private String secondary; + + /** + * Get the primary property: Primary gateway key. + * + * @return the primary value. + */ + public String primary() { + return this.primary; + } + + /** + * Set the primary property: Primary gateway key. + * + * @param primary the primary value to set. + * @return the GatewayKeysContractInner object itself. + */ + public GatewayKeysContractInner withPrimary(String primary) { + this.primary = primary; + return this; + } + + /** + * Get the secondary property: Secondary gateway key. + * + * @return the secondary value. + */ + public String secondary() { + return this.secondary; + } + + /** + * Set the secondary property: Secondary gateway key. + * + * @param secondary the secondary value to set. + * @return the GatewayKeysContractInner object itself. + */ + public GatewayKeysContractInner withSecondary(String secondary) { + this.secondary = secondary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayTokenContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayTokenContractInner.java new file mode 100644 index 0000000000000..dfec00354e95a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GatewayTokenContractInner.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.apimanagement.fluent.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; + +/** Gateway access token. */ +@Fluent +public final class GatewayTokenContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayTokenContractInner.class); + + /* + * Shared Access Authentication token value for the Gateway. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: Shared Access Authentication token value for the Gateway. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Shared Access Authentication token value for the Gateway. + * + * @param value the value value to set. + * @return the GatewayTokenContractInner object itself. + */ + public GatewayTokenContractInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GenerateSsoUrlResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GenerateSsoUrlResultInner.java new file mode 100644 index 0000000000000..8e5cfeed5168e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GenerateSsoUrlResultInner.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.apimanagement.fluent.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; + +/** Generate SSO Url operations response details. */ +@Fluent +public final class GenerateSsoUrlResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GenerateSsoUrlResultInner.class); + + /* + * Redirect Url containing the SSO URL value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: Redirect Url containing the SSO URL value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Redirect Url containing the SSO URL value. + * + * @param value the value value to set. + * @return the GenerateSsoUrlResultInner object itself. + */ + public GenerateSsoUrlResultInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GroupContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GroupContractInner.java new file mode 100644 index 0000000000000..3f4355bfbb09c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/GroupContractInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.GroupType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contract details. */ +@JsonFlatten +@Fluent +public class GroupContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupContractInner.class); + + /* + * Group name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Group description. Can contain HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * true if the group is one of the three system groups (Administrators, + * Developers, or Guests); otherwise false. + */ + @JsonProperty(value = "properties.builtIn", access = JsonProperty.Access.WRITE_ONLY) + private Boolean builtIn; + + /* + * Group type. + */ + @JsonProperty(value = "properties.type") + private GroupType typePropertiesType; + + /* + * For external groups, this property contains the id of the group from the + * external identity provider, e.g. for Azure Active Directory + * `aad://.onmicrosoft.com/groups/`; otherwise the + * value is null. + */ + @JsonProperty(value = "properties.externalId") + private String externalId; + + /** + * Get the displayName property: Group name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Group name. + * + * @param displayName the displayName value to set. + * @return the GroupContractInner object itself. + */ + public GroupContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: Group description. Can contain HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Group description. Can contain HTML formatting tags. + * + * @param description the description value to set. + * @return the GroupContractInner object itself. + */ + public GroupContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the builtIn property: true if the group is one of the three system groups (Administrators, Developers, or + * Guests); otherwise false. + * + * @return the builtIn value. + */ + public Boolean builtIn() { + return this.builtIn; + } + + /** + * Get the typePropertiesType property: Group type. + * + * @return the typePropertiesType value. + */ + public GroupType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Group type. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the GroupContractInner object itself. + */ + public GroupContractInner withTypePropertiesType(GroupType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the externalId property: For external groups, this property contains the id of the group from the external + * identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object + * id>`; otherwise the value is null. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: For external groups, this property contains the id of the group from the external + * identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object + * id>`; otherwise the value is null. + * + * @param externalId the externalId value to set. + * @return the GroupContractInner object itself. + */ + public GroupContractInner withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IdentityProviderContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IdentityProviderContractInner.java new file mode 100644 index 0000000000000..423a008afad10 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IdentityProviderContractInner.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.IdentityProviderType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Identity Provider details. */ +@JsonFlatten +@Fluent +public class IdentityProviderContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderContractInner.class); + + /* + * Identity Provider Type identifier. + */ + @JsonProperty(value = "properties.type") + private IdentityProviderType typePropertiesType; + + /* + * The TenantId to use instead of Common when logging into Active Directory + */ + @JsonProperty(value = "properties.signinTenant") + private String signinTenant; + + /* + * List of Allowed Tenants when configuring Azure Active Directory login. + */ + @JsonProperty(value = "properties.allowedTenants") + private List allowedTenants; + + /* + * OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + */ + @JsonProperty(value = "properties.authority") + private String authority; + + /* + * Signup Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.signupPolicyName") + private String signupPolicyName; + + /* + * Signin Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.signinPolicyName") + private String signinPolicyName; + + /* + * Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.profileEditingPolicyName") + private String profileEditingPolicyName; + + /* + * Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.passwordResetPolicyName") + private String passwordResetPolicyName; + + /* + * Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for + * Microsoft. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook + * login, API Key for Google login, Public Key for Microsoft. This property + * will not be filled on 'GET' operations! Use '/listSecrets' POST request + * to get the value. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the typePropertiesType property: Identity Provider Type identifier. + * + * @return the typePropertiesType value. + */ + public IdentityProviderType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Identity Provider Type identifier. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withTypePropertiesType(IdentityProviderType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @return the signinTenant value. + */ + public String signinTenant() { + return this.signinTenant; + } + + /** + * Set the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @param signinTenant the signinTenant value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withSigninTenant(String signinTenant) { + this.signinTenant = signinTenant; + return this; + } + + /** + * Get the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @return the allowedTenants value. + */ + public List allowedTenants() { + return this.allowedTenants; + } + + /** + * Set the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @param allowedTenants the allowedTenants value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withAllowedTenants(List allowedTenants) { + this.allowedTenants = allowedTenants; + return this; + } + + /** + * Get the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @param authority the authority value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signupPolicyName value. + */ + public String signupPolicyName() { + return this.signupPolicyName; + } + + /** + * Set the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signupPolicyName the signupPolicyName value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withSignupPolicyName(String signupPolicyName) { + this.signupPolicyName = signupPolicyName; + return this; + } + + /** + * Get the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signinPolicyName value. + */ + public String signinPolicyName() { + return this.signinPolicyName; + } + + /** + * Set the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signinPolicyName the signinPolicyName value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withSigninPolicyName(String signinPolicyName) { + this.signinPolicyName = signinPolicyName; + return this; + } + + /** + * Get the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @return the profileEditingPolicyName value. + */ + public String profileEditingPolicyName() { + return this.profileEditingPolicyName; + } + + /** + * Set the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @param profileEditingPolicyName the profileEditingPolicyName value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withProfileEditingPolicyName(String profileEditingPolicyName) { + this.profileEditingPolicyName = profileEditingPolicyName; + return this; + } + + /** + * Get the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the passwordResetPolicyName value. + */ + public String passwordResetPolicyName() { + return this.passwordResetPolicyName; + } + + /** + * Set the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param passwordResetPolicyName the passwordResetPolicyName value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withPasswordResetPolicyName(String passwordResetPolicyName) { + this.passwordResetPolicyName = passwordResetPolicyName; + return this; + } + + /** + * Get the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @param clientId the clientId value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param clientSecret the clientSecret value to set. + * @return the IdentityProviderContractInner object itself. + */ + public IdentityProviderContractInner withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueAttachmentContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueAttachmentContractInner.java new file mode 100644 index 0000000000000..291c1f1880058 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueAttachmentContractInner.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Issue Attachment Contract details. */ +@JsonFlatten +@Fluent +public class IssueAttachmentContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueAttachmentContractInner.class); + + /* + * Filename by which the binary data will be saved. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Either 'link' if content is provided via an HTTP link or the MIME type + * of the Base64-encoded binary data provided in the 'content' property. + */ + @JsonProperty(value = "properties.contentFormat") + private String contentFormat; + + /* + * An HTTP link or Base64-encoded binary data. + */ + @JsonProperty(value = "properties.content") + private String content; + + /** + * Get the title property: Filename by which the binary data will be saved. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Filename by which the binary data will be saved. + * + * @param title the title value to set. + * @return the IssueAttachmentContractInner object itself. + */ + public IssueAttachmentContractInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the contentFormat property: Either 'link' if content is provided via an HTTP link or the MIME type of the + * Base64-encoded binary data provided in the 'content' property. + * + * @return the contentFormat value. + */ + public String contentFormat() { + return this.contentFormat; + } + + /** + * Set the contentFormat property: Either 'link' if content is provided via an HTTP link or the MIME type of the + * Base64-encoded binary data provided in the 'content' property. + * + * @param contentFormat the contentFormat value to set. + * @return the IssueAttachmentContractInner object itself. + */ + public IssueAttachmentContractInner withContentFormat(String contentFormat) { + this.contentFormat = contentFormat; + return this; + } + + /** + * Get the content property: An HTTP link or Base64-encoded binary data. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: An HTTP link or Base64-encoded binary data. + * + * @param content the content value to set. + * @return the IssueAttachmentContractInner object itself. + */ + public IssueAttachmentContractInner withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueCommentContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueCommentContractInner.java new file mode 100644 index 0000000000000..fbd73a4725240 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueCommentContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Issue Comment Contract details. */ +@JsonFlatten +@Fluent +public class IssueCommentContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueCommentContractInner.class); + + /* + * Comment text. + */ + @JsonProperty(value = "properties.text") + private String text; + + /* + * Date and time when the comment was created. + */ + @JsonProperty(value = "properties.createdDate") + private OffsetDateTime createdDate; + + /* + * A resource identifier for the user who left the comment. + */ + @JsonProperty(value = "properties.userId") + private String userId; + + /** + * Get the text property: Comment text. + * + * @return the text value. + */ + public String text() { + return this.text; + } + + /** + * Set the text property: Comment text. + * + * @param text the text value to set. + * @return the IssueCommentContractInner object itself. + */ + public IssueCommentContractInner withText(String text) { + this.text = text; + return this; + } + + /** + * Get the createdDate property: Date and time when the comment was created. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: Date and time when the comment was created. + * + * @param createdDate the createdDate value to set. + * @return the IssueCommentContractInner object itself. + */ + public IssueCommentContractInner withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the userId property: A resource identifier for the user who left the comment. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: A resource identifier for the user who left the comment. + * + * @param userId the userId value to set. + * @return the IssueCommentContractInner object itself. + */ + public IssueCommentContractInner withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueContractInner.java new file mode 100644 index 0000000000000..e57a88ea66a69 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/IssueContractInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.State; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Issue Contract details. */ +@JsonFlatten +@Fluent +public class IssueContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueContractInner.class); + + /* + * Date and time when the issue was created. + */ + @JsonProperty(value = "properties.createdDate") + private OffsetDateTime createdDate; + + /* + * Status of the issue. + */ + @JsonProperty(value = "properties.state") + private State state; + + /* + * A resource identifier for the API the issue was created for. + */ + @JsonProperty(value = "properties.apiId") + private String apiId; + + /* + * The issue title. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Text describing the issue. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * A resource identifier for the user created the issue. + */ + @JsonProperty(value = "properties.userId") + private String userId; + + /** + * Get the createdDate property: Date and time when the issue was created. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: Date and time when the issue was created. + * + * @param createdDate the createdDate value to set. + * @return the IssueContractInner object itself. + */ + public IssueContractInner withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state property: Status of the issue. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Status of the issue. + * + * @param state the state value to set. + * @return the IssueContractInner object itself. + */ + public IssueContractInner withState(State state) { + this.state = state; + return this; + } + + /** + * Get the apiId property: A resource identifier for the API the issue was created for. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: A resource identifier for the API the issue was created for. + * + * @param apiId the apiId value to set. + * @return the IssueContractInner object itself. + */ + public IssueContractInner withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Get the title property: The issue title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The issue title. + * + * @param title the title value to set. + * @return the IssueContractInner object itself. + */ + public IssueContractInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Text describing the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text describing the issue. + * + * @param description the description value to set. + * @return the IssueContractInner object itself. + */ + public IssueContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the userId property: A resource identifier for the user created the issue. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: A resource identifier for the user created the issue. + * + * @param userId the userId value to set. + * @return the IssueContractInner object itself. + */ + public IssueContractInner withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/LoggerContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/LoggerContractInner.java new file mode 100644 index 0000000000000..f0789b88ceb35 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/LoggerContractInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.LoggerType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Logger details. */ +@JsonFlatten +@Fluent +public class LoggerContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggerContractInner.class); + + /* + * Logger type. + */ + @JsonProperty(value = "properties.loggerType") + private LoggerType loggerType; + + /* + * Logger description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The name and SendRule connection string of the event hub for + * azureEventHub logger. + * Instrumentation key for applicationInsights logger. + */ + @JsonProperty(value = "properties.credentials") + private Map credentials; + + /* + * Whether records are buffered in the logger before publishing. Default is + * assumed to be true. + */ + @JsonProperty(value = "properties.isBuffered") + private Boolean isBuffered; + + /* + * Azure Resource Id of a log target (either Azure Event Hub resource or + * Azure Application Insights resource). + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the loggerType property: Logger type. + * + * @return the loggerType value. + */ + public LoggerType loggerType() { + return this.loggerType; + } + + /** + * Set the loggerType property: Logger type. + * + * @param loggerType the loggerType value to set. + * @return the LoggerContractInner object itself. + */ + public LoggerContractInner withLoggerType(LoggerType loggerType) { + this.loggerType = loggerType; + return this; + } + + /** + * Get the description property: Logger description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Logger description. + * + * @param description the description value to set. + * @return the LoggerContractInner object itself. + */ + public LoggerContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the credentials property: The name and SendRule connection string of the event hub for azureEventHub logger. + * Instrumentation key for applicationInsights logger. + * + * @return the credentials value. + */ + public Map credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The name and SendRule connection string of the event hub for azureEventHub logger. + * Instrumentation key for applicationInsights logger. + * + * @param credentials the credentials value to set. + * @return the LoggerContractInner object itself. + */ + public LoggerContractInner withCredentials(Map credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to + * be true. + * + * @return the isBuffered value. + */ + public Boolean isBuffered() { + return this.isBuffered; + } + + /** + * Set the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to + * be true. + * + * @param isBuffered the isBuffered value to set. + * @return the LoggerContractInner object itself. + */ + public LoggerContractInner withIsBuffered(Boolean isBuffered) { + this.isBuffered = isBuffered; + return this; + } + + /** + * Get the resourceId property: Azure Resource Id of a log target (either Azure Event Hub resource or Azure + * Application Insights resource). + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Azure Resource Id of a log target (either Azure Event Hub resource or Azure + * Application Insights resource). + * + * @param resourceId the resourceId value to set. + * @return the LoggerContractInner object itself. + */ + public LoggerContractInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueContractInner.java new file mode 100644 index 0000000000000..26267e4fbcb49 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueContractInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.KeyVaultContractProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NamedValue details. */ +@JsonFlatten +@Fluent +public class NamedValueContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueContractInner.class); + + /* + * Optional tags that when provided can be used to filter the NamedValue + * list. + */ + @JsonProperty(value = "properties.tags") + private List tags; + + /* + * Determines whether the value is a secret and should be encrypted or not. + * Default value is false. + */ + @JsonProperty(value = "properties.secret") + private Boolean secret; + + /* + * Unique name of NamedValue. It may contain only letters, digits, period, + * dash, and underscore characters. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. This property will not be filled on + * 'GET' operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "properties.value") + private String value; + + /* + * KeyVault location details of the namedValue. + */ + @JsonProperty(value = "properties.keyVault") + private KeyVaultContractProperties keyVault; + + /** + * Get the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @param tags the tags value to set. + * @return the NamedValueContractInner object itself. + */ + public NamedValueContractInner withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @return the secret value. + */ + public Boolean secret() { + return this.secret; + } + + /** + * Set the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @param secret the secret value to set. + * @return the NamedValueContractInner object itself. + */ + public NamedValueContractInner withSecret(Boolean secret) { + this.secret = secret; + return this; + } + + /** + * Get the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @param displayName the displayName value to set. + * @return the NamedValueContractInner object itself. + */ + public NamedValueContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param value the value value to set. + * @return the NamedValueContractInner object itself. + */ + public NamedValueContractInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + public KeyVaultContractProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the namedValue. + * + * @param keyVault the keyVault value to set. + * @return the NamedValueContractInner object itself. + */ + public NamedValueContractInner withKeyVault(KeyVaultContractProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueSecretContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueSecretContractInner.java new file mode 100644 index 0000000000000..32c5f17f68df1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NamedValueSecretContractInner.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.apimanagement.fluent.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; + +/** Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. */ +@Fluent +public final class NamedValueSecretContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueSecretContractInner.class); + + /* + * This is secret value of the NamedValue entity. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: This is secret value of the NamedValue entity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: This is secret value of the NamedValue entity. + * + * @param value the value value to set. + * @return the NamedValueSecretContractInner object itself. + */ + public NamedValueSecretContractInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractByLocationInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractByLocationInner.java new file mode 100644 index 0000000000000..365d995b91a4e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractByLocationInner.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.apimanagement.fluent.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; + +/** Network Status in the Location. */ +@Fluent +public final class NetworkStatusContractByLocationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkStatusContractByLocationInner.class); + + /* + * Location of service + */ + @JsonProperty(value = "location") + private String location; + + /* + * Network status in Location + */ + @JsonProperty(value = "networkStatus") + private NetworkStatusContractInner networkStatus; + + /** + * Get the location property: Location of service. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of service. + * + * @param location the location value to set. + * @return the NetworkStatusContractByLocationInner object itself. + */ + public NetworkStatusContractByLocationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the networkStatus property: Network status in Location. + * + * @return the networkStatus value. + */ + public NetworkStatusContractInner networkStatus() { + return this.networkStatus; + } + + /** + * Set the networkStatus property: Network status in Location. + * + * @param networkStatus the networkStatus value to set. + * @return the NetworkStatusContractByLocationInner object itself. + */ + public NetworkStatusContractByLocationInner withNetworkStatus(NetworkStatusContractInner networkStatus) { + this.networkStatus = networkStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkStatus() != null) { + networkStatus().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractInner.java new file mode 100644 index 0000000000000..52d89acc0172b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NetworkStatusContractInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.ConnectivityStatusContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Status details. */ +@Fluent +public final class NetworkStatusContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkStatusContractInner.class); + + /* + * Gets the list of DNS servers IPV4 addresses. + */ + @JsonProperty(value = "dnsServers", required = true) + private List dnsServers; + + /* + * Gets the list of Connectivity Status to the Resources on which the + * service depends upon. + */ + @JsonProperty(value = "connectivityStatus", required = true) + private List connectivityStatus; + + /** + * Get the dnsServers property: Gets the list of DNS servers IPV4 addresses. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: Gets the list of DNS servers IPV4 addresses. + * + * @param dnsServers the dnsServers value to set. + * @return the NetworkStatusContractInner object itself. + */ + public NetworkStatusContractInner withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the connectivityStatus property: Gets the list of Connectivity Status to the Resources on which the service + * depends upon. + * + * @return the connectivityStatus value. + */ + public List connectivityStatus() { + return this.connectivityStatus; + } + + /** + * Set the connectivityStatus property: Gets the list of Connectivity Status to the Resources on which the service + * depends upon. + * + * @param connectivityStatus the connectivityStatus value to set. + * @return the NetworkStatusContractInner object itself. + */ + public NetworkStatusContractInner withConnectivityStatus(List connectivityStatus) { + this.connectivityStatus = connectivityStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsServers() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dnsServers in model NetworkStatusContractInner")); + } + if (connectivityStatus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectivityStatus in model NetworkStatusContractInner")); + } else { + connectivityStatus().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NotificationContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NotificationContractInner.java new file mode 100644 index 0000000000000..badebd972543d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/NotificationContractInner.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.RecipientsContractProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Notification details. */ +@JsonFlatten +@Fluent +public class NotificationContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationContractInner.class); + + /* + * Title of the Notification. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Description of the Notification. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Recipient Parameter values. + */ + @JsonProperty(value = "properties.recipients") + private RecipientsContractProperties recipients; + + /** + * Get the title property: Title of the Notification. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title of the Notification. + * + * @param title the title value to set. + * @return the NotificationContractInner object itself. + */ + public NotificationContractInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Description of the Notification. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the Notification. + * + * @param description the description value to set. + * @return the NotificationContractInner object itself. + */ + public NotificationContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the recipients property: Recipient Parameter values. + * + * @return the recipients value. + */ + public RecipientsContractProperties recipients() { + return this.recipients; + } + + /** + * Set the recipients property: Recipient Parameter values. + * + * @param recipients the recipients value to set. + * @return the NotificationContractInner object itself. + */ + public NotificationContractInner withRecipients(RecipientsContractProperties recipients) { + this.recipients = recipients; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recipients() != null) { + recipients().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OpenidConnectProviderContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OpenidConnectProviderContractInner.java new file mode 100644 index 0000000000000..33d86724e363d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OpenidConnectProviderContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OpenId Connect Provider details. */ +@JsonFlatten +@Fluent +public class OpenidConnectProviderContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenidConnectProviderContractInner.class); + + /* + * User-friendly OpenID Connect Provider name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * User-friendly description of OpenID Connect Provider. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Metadata endpoint URI. + */ + @JsonProperty(value = "properties.metadataEndpoint") + private String metadataEndpoint; + + /* + * Client ID of developer console which is the client application. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client Secret of developer console which is the client application. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the displayName property: User-friendly OpenID Connect Provider name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User-friendly OpenID Connect Provider name. + * + * @param displayName the displayName value to set. + * @return the OpenidConnectProviderContractInner object itself. + */ + public OpenidConnectProviderContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: User-friendly description of OpenID Connect Provider. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-friendly description of OpenID Connect Provider. + * + * @param description the description value to set. + * @return the OpenidConnectProviderContractInner object itself. + */ + public OpenidConnectProviderContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the metadataEndpoint property: Metadata endpoint URI. + * + * @return the metadataEndpoint value. + */ + public String metadataEndpoint() { + return this.metadataEndpoint; + } + + /** + * Set the metadataEndpoint property: Metadata endpoint URI. + * + * @param metadataEndpoint the metadataEndpoint value to set. + * @return the OpenidConnectProviderContractInner object itself. + */ + public OpenidConnectProviderContractInner withMetadataEndpoint(String metadataEndpoint) { + this.metadataEndpoint = metadataEndpoint; + return this; + } + + /** + * Get the clientId property: Client ID of developer console which is the client application. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client ID of developer console which is the client application. + * + * @param clientId the clientId value to set. + * @return the OpenidConnectProviderContractInner object itself. + */ + public OpenidConnectProviderContractInner withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client Secret of developer console which is the client application. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client Secret of developer console which is the client application. + * + * @param clientSecret the clientSecret value to set. + * @return the OpenidConnectProviderContractInner object itself. + */ + public OpenidConnectProviderContractInner withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationContractInner.java new file mode 100644 index 0000000000000..ac300d93b4b5a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationContractInner.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.apimanagement.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.apimanagement.models.ParameterContract; +import com.azure.resourcemanager.apimanagement.models.RequestContract; +import com.azure.resourcemanager.apimanagement.models.ResponseContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Api Operation details. */ +@JsonFlatten +@Fluent +public class OperationContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationContractInner.class); + + /* + * Collection of URL template parameters. + */ + @JsonProperty(value = "properties.templateParameters") + private List templateParameters; + + /* + * Description of the operation. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * An entity containing request details. + */ + @JsonProperty(value = "properties.request") + private RequestContract request; + + /* + * Array of Operation responses. + */ + @JsonProperty(value = "properties.responses") + private List responses; + + /* + * Operation Policies + */ + @JsonProperty(value = "properties.policies") + private String policies; + + /* + * Operation Name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them. + */ + @JsonProperty(value = "properties.method") + private String method; + + /* + * Relative URL template identifying the target resource for this + * operation. May include parameters. Example: + * /customers/{cid}/orders/{oid}/?date={date} + */ + @JsonProperty(value = "properties.urlTemplate") + private String urlTemplate; + + /** + * Get the templateParameters property: Collection of URL template parameters. + * + * @return the templateParameters value. + */ + public List templateParameters() { + return this.templateParameters; + } + + /** + * Set the templateParameters property: Collection of URL template parameters. + * + * @param templateParameters the templateParameters value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withTemplateParameters(List templateParameters) { + this.templateParameters = templateParameters; + return this; + } + + /** + * Get the description property: Description of the operation. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the request property: An entity containing request details. + * + * @return the request value. + */ + public RequestContract request() { + return this.request; + } + + /** + * Set the request property: An entity containing request details. + * + * @param request the request value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withRequest(RequestContract request) { + this.request = request; + return this; + } + + /** + * Get the responses property: Array of Operation responses. + * + * @return the responses value. + */ + public List responses() { + return this.responses; + } + + /** + * Set the responses property: Array of Operation responses. + * + * @param responses the responses value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withResponses(List responses) { + this.responses = responses; + return this; + } + + /** + * Get the policies property: Operation Policies. + * + * @return the policies value. + */ + public String policies() { + return this.policies; + } + + /** + * Set the policies property: Operation Policies. + * + * @param policies the policies value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withPolicies(String policies) { + this.policies = policies; + return this; + } + + /** + * Get the displayName property: Operation Name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Operation Name. + * + * @param displayName the displayName value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @param method the method value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @return the urlTemplate value. + */ + public String urlTemplate() { + return this.urlTemplate; + } + + /** + * Set the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @param urlTemplate the urlTemplate value to set. + * @return the OperationContractInner object itself. + */ + public OperationContractInner withUrlTemplate(String urlTemplate) { + this.urlTemplate = urlTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateParameters() != null) { + templateParameters().forEach(e -> e.validate()); + } + if (request() != null) { + request().validate(); + } + if (responses() != null) { + responses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..3f1c01656a6b6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The operation origin. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * The operation properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that describes the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that describes the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The operation origin. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The operation origin. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: The operation properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The operation properties. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationResultContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationResultContractInner.java new file mode 100644 index 0000000000000..f2dadb322dede --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/OperationResultContractInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.AsyncOperationStatus; +import com.azure.resourcemanager.apimanagement.models.ErrorResponseBody; +import com.azure.resourcemanager.apimanagement.models.OperationResultLogItemContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Operation Result. */ +@Fluent +public final class OperationResultContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultContractInner.class); + + /* + * Operation result identifier. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Status of an async operation. + */ + @JsonProperty(value = "status") + private AsyncOperationStatus status; + + /* + * Start time of an async operation. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "started") + private OffsetDateTime started; + + /* + * Last update time of an async operation. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + */ + @JsonProperty(value = "updated") + private OffsetDateTime updated; + + /* + * Optional result info. + */ + @JsonProperty(value = "resultInfo") + private String resultInfo; + + /* + * Error Body Contract + */ + @JsonProperty(value = "error") + private ErrorResponseBody error; + + /* + * This property if only provided as part of the + * TenantConfiguration_Validate operation. It contains the log the entities + * which will be updated/created/deleted as part of the + * TenantConfiguration_Deploy operation. + */ + @JsonProperty(value = "actionLog", access = JsonProperty.Access.WRITE_ONLY) + private List actionLog; + + /** + * Get the id property: Operation result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Operation result identifier. + * + * @param id the id value to set. + * @return the OperationResultContractInner object itself. + */ + public OperationResultContractInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the status property: Status of an async operation. + * + * @return the status value. + */ + public AsyncOperationStatus status() { + return this.status; + } + + /** + * Set the status property: Status of an async operation. + * + * @param status the status value to set. + * @return the OperationResultContractInner object itself. + */ + public OperationResultContractInner withStatus(AsyncOperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the started property: Start time of an async operation. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the started value. + */ + public OffsetDateTime started() { + return this.started; + } + + /** + * Set the started property: Start time of an async operation. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param started the started value to set. + * @return the OperationResultContractInner object itself. + */ + public OperationResultContractInner withStarted(OffsetDateTime started) { + this.started = started; + return this; + } + + /** + * Get the updated property: Last update time of an async operation. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Set the updated property: Last update time of an async operation. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param updated the updated value to set. + * @return the OperationResultContractInner object itself. + */ + public OperationResultContractInner withUpdated(OffsetDateTime updated) { + this.updated = updated; + return this; + } + + /** + * Get the resultInfo property: Optional result info. + * + * @return the resultInfo value. + */ + public String resultInfo() { + return this.resultInfo; + } + + /** + * Set the resultInfo property: Optional result info. + * + * @param resultInfo the resultInfo value to set. + * @return the OperationResultContractInner object itself. + */ + public OperationResultContractInner withResultInfo(String resultInfo) { + this.resultInfo = resultInfo; + return this; + } + + /** + * Get the error property: Error Body Contract. + * + * @return the error value. + */ + public ErrorResponseBody error() { + return this.error; + } + + /** + * Set the error property: Error Body Contract. + * + * @param error the error value to set. + * @return the OperationResultContractInner object itself. + */ + public OperationResultContractInner withError(ErrorResponseBody error) { + this.error = error; + return this; + } + + /** + * Get the actionLog property: This property if only provided as part of the TenantConfiguration_Validate operation. + * It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy + * operation. + * + * @return the actionLog value. + */ + public List actionLog() { + return this.actionLog; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (actionLog() != null) { + actionLog().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyCollectionInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyCollectionInner.java new file mode 100644 index 0000000000000..f36aa0189f762 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyCollectionInner.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.apimanagement.fluent.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 response of the list policy operation. */ +@Fluent +public final class PolicyCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyCollectionInner.class); + + /* + * Policy Contract value. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Policy Contract value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Policy Contract value. + * + * @param value the value value to set. + * @return the PolicyCollectionInner object itself. + */ + public PolicyCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number. + * + * @param count the count value to set. + * @return the PolicyCollectionInner object itself. + */ + public PolicyCollectionInner withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the PolicyCollectionInner object itself. + */ + public PolicyCollectionInner 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyContractInner.java new file mode 100644 index 0000000000000..8c086602e21a3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyContractInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.PolicyContentFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy Contract details. */ +@JsonFlatten +@Fluent +public class PolicyContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyContractInner.class); + + /* + * Contents of the Policy as defined by the format. + */ + @JsonProperty(value = "properties.value") + private String value; + + /* + * Format of the policyContent. + */ + @JsonProperty(value = "properties.format") + private PolicyContentFormat format; + + /** + * Get the value property: Contents of the Policy as defined by the format. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Contents of the Policy as defined by the format. + * + * @param value the value value to set. + * @return the PolicyContractInner object itself. + */ + public PolicyContractInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the format property: Format of the policyContent. + * + * @return the format value. + */ + public PolicyContentFormat format() { + return this.format; + } + + /** + * Set the format property: Format of the policyContent. + * + * @param format the format value to set. + * @return the PolicyContractInner object itself. + */ + public PolicyContractInner withFormat(PolicyContentFormat format) { + this.format = format; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyDescriptionCollectionInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyDescriptionCollectionInner.java new file mode 100644 index 0000000000000..73f80f1da8284 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PolicyDescriptionCollectionInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.PolicyDescriptionContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Descriptions of APIM policies. */ +@Fluent +public final class PolicyDescriptionCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDescriptionCollectionInner.class); + + /* + * Descriptions of APIM policies. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number. + */ + @JsonProperty(value = "count") + private Long count; + + /** + * Get the value property: Descriptions of APIM policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Descriptions of APIM policies. + * + * @param value the value value to set. + * @return the PolicyDescriptionCollectionInner object itself. + */ + public PolicyDescriptionCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number. + * + * @param count the count value to set. + * @return the PolicyDescriptionCollectionInner object itself. + */ + public PolicyDescriptionCollectionInner withCount(Long count) { + this.count = count; + 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalDelegationSettingsInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalDelegationSettingsInner.java new file mode 100644 index 0000000000000..062a7d7fe67e6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalDelegationSettingsInner.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.apimanagement.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.apimanagement.models.RegistrationDelegationSettingsProperties; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsDelegationSettingsProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Delegation settings for a developer portal. */ +@JsonFlatten +@Fluent +public class PortalDelegationSettingsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalDelegationSettingsInner.class); + + /* + * A delegation Url. + */ + @JsonProperty(value = "properties.url") + private String url; + + /* + * A base64-encoded validation key to validate, that a request is coming + * from Azure API Management. + */ + @JsonProperty(value = "properties.validationKey") + private String validationKey; + + /* + * Subscriptions delegation settings. + */ + @JsonProperty(value = "properties.subscriptions") + private SubscriptionsDelegationSettingsProperties subscriptions; + + /* + * User registration delegation settings. + */ + @JsonProperty(value = "properties.userRegistration") + private RegistrationDelegationSettingsProperties userRegistration; + + /** + * Get the url property: A delegation Url. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: A delegation Url. + * + * @param url the url value to set. + * @return the PortalDelegationSettingsInner object itself. + */ + public PortalDelegationSettingsInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the validationKey property: A base64-encoded validation key to validate, that a request is coming from Azure + * API Management. + * + * @return the validationKey value. + */ + public String validationKey() { + return this.validationKey; + } + + /** + * Set the validationKey property: A base64-encoded validation key to validate, that a request is coming from Azure + * API Management. + * + * @param validationKey the validationKey value to set. + * @return the PortalDelegationSettingsInner object itself. + */ + public PortalDelegationSettingsInner withValidationKey(String validationKey) { + this.validationKey = validationKey; + return this; + } + + /** + * Get the subscriptions property: Subscriptions delegation settings. + * + * @return the subscriptions value. + */ + public SubscriptionsDelegationSettingsProperties subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: Subscriptions delegation settings. + * + * @param subscriptions the subscriptions value to set. + * @return the PortalDelegationSettingsInner object itself. + */ + public PortalDelegationSettingsInner withSubscriptions(SubscriptionsDelegationSettingsProperties subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Get the userRegistration property: User registration delegation settings. + * + * @return the userRegistration value. + */ + public RegistrationDelegationSettingsProperties userRegistration() { + return this.userRegistration; + } + + /** + * Set the userRegistration property: User registration delegation settings. + * + * @param userRegistration the userRegistration value to set. + * @return the PortalDelegationSettingsInner object itself. + */ + public PortalDelegationSettingsInner withUserRegistration( + RegistrationDelegationSettingsProperties userRegistration) { + this.userRegistration = userRegistration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().validate(); + } + if (userRegistration() != null) { + userRegistration().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalRevisionContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalRevisionContractInner.java new file mode 100644 index 0000000000000..37f7f9afc6043 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalRevisionContractInner.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.PortalRevisionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Portal revisions contract details. */ +@JsonFlatten +@Fluent +public class PortalRevisionContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionContractInner.class); + + /* + * Portal revision description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Portal revision publishing status details. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /* + * Portal revision publishing status + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private PortalRevisionStatus status; + + /* + * Indicates if the Portal Revision is public. + */ + @JsonProperty(value = "properties.isCurrent") + private Boolean isCurrent; + + /* + * Portal revision creation date and time. + */ + @JsonProperty(value = "properties.createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * Last updated date and time. + */ + @JsonProperty(value = "properties.updatedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedDateTime; + + /** + * Get the description property: Portal revision description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Portal revision description. + * + * @param description the description value to set. + * @return the PortalRevisionContractInner object itself. + */ + public PortalRevisionContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the statusDetails property: Portal revision publishing status details. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the status property: Portal revision publishing status. + * + * @return the status value. + */ + public PortalRevisionStatus status() { + return this.status; + } + + /** + * Get the isCurrent property: Indicates if the Portal Revision is public. + * + * @return the isCurrent value. + */ + public Boolean isCurrent() { + return this.isCurrent; + } + + /** + * Set the isCurrent property: Indicates if the Portal Revision is public. + * + * @param isCurrent the isCurrent value to set. + * @return the PortalRevisionContractInner object itself. + */ + public PortalRevisionContractInner withIsCurrent(Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get the createdDateTime property: Portal revision creation date and time. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the updatedDateTime property: Last updated date and time. + * + * @return the updatedDateTime value. + */ + public OffsetDateTime updatedDateTime() { + return this.updatedDateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingValidationKeyContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingValidationKeyContractInner.java new file mode 100644 index 0000000000000..3a863d490e5f2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingValidationKeyContractInner.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.apimanagement.fluent.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; + +/** Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. */ +@Fluent +public final class PortalSettingValidationKeyContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalSettingValidationKeyContractInner.class); + + /* + * This is secret value of the validation key in portal settings. + */ + @JsonProperty(value = "validationKey") + private String validationKey; + + /** + * Get the validationKey property: This is secret value of the validation key in portal settings. + * + * @return the validationKey value. + */ + public String validationKey() { + return this.validationKey; + } + + /** + * Set the validationKey property: This is secret value of the validation key in portal settings. + * + * @param validationKey the validationKey value to set. + * @return the PortalSettingValidationKeyContractInner object itself. + */ + public PortalSettingValidationKeyContractInner withValidationKey(String validationKey) { + this.validationKey = validationKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingsCollectionInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingsCollectionInner.java new file mode 100644 index 0000000000000..d8d2c6f4f54df --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSettingsCollectionInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.PortalSettingsContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Descriptions of APIM policies. */ +@Fluent +public final class PortalSettingsCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalSettingsCollectionInner.class); + + /* + * Descriptions of APIM policies. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number. + */ + @JsonProperty(value = "count") + private Long count; + + /** + * Get the value property: Descriptions of APIM policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Descriptions of APIM policies. + * + * @param value the value value to set. + * @return the PortalSettingsCollectionInner object itself. + */ + public PortalSettingsCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number. + * + * @param count the count value to set. + * @return the PortalSettingsCollectionInner object itself. + */ + public PortalSettingsCollectionInner withCount(Long count) { + this.count = count; + 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSigninSettingsInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSigninSettingsInner.java new file mode 100644 index 0000000000000..f50b2dd3f7a0b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSigninSettingsInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sign-In settings for the Developer Portal. */ +@JsonFlatten +@Fluent +public class PortalSigninSettingsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalSigninSettingsInner.class); + + /* + * Redirect Anonymous users to the Sign-In page. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Get the enabled property: Redirect Anonymous users to the Sign-In page. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Redirect Anonymous users to the Sign-In page. + * + * @param enabled the enabled value to set. + * @return the PortalSigninSettingsInner object itself. + */ + public PortalSigninSettingsInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSignupSettingsInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSignupSettingsInner.java new file mode 100644 index 0000000000000..ad96b41895536 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/PortalSignupSettingsInner.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.apimanagement.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.apimanagement.models.TermsOfServiceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sign-Up settings for a developer portal. */ +@JsonFlatten +@Fluent +public class PortalSignupSettingsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalSignupSettingsInner.class); + + /* + * Allow users to sign up on a developer portal. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * Terms of service contract properties. + */ + @JsonProperty(value = "properties.termsOfService") + private TermsOfServiceProperties termsOfService; + + /** + * Get the enabled property: Allow users to sign up on a developer portal. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Allow users to sign up on a developer portal. + * + * @param enabled the enabled value to set. + * @return the PortalSignupSettingsInner object itself. + */ + public PortalSignupSettingsInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the termsOfService property: Terms of service contract properties. + * + * @return the termsOfService value. + */ + public TermsOfServiceProperties termsOfService() { + return this.termsOfService; + } + + /** + * Set the termsOfService property: Terms of service contract properties. + * + * @param termsOfService the termsOfService value to set. + * @return the PortalSignupSettingsInner object itself. + */ + public PortalSignupSettingsInner withTermsOfService(TermsOfServiceProperties termsOfService) { + this.termsOfService = termsOfService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (termsOfService() != null) { + termsOfService().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ProductContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ProductContractInner.java new file mode 100644 index 0000000000000..8098c6cd6ce27 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ProductContractInner.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.ProductState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Product details. */ +@JsonFlatten +@Fluent +public class ProductContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductContractInner.class); + + /* + * Product description. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Product terms of use. Developers trying to subscribe to the product will + * be presented and required to accept these terms before they can complete + * the subscription process. + */ + @JsonProperty(value = "properties.terms") + private String terms; + + /* + * Whether a product subscription is required for accessing APIs included + * in this product. If true, the product is referred to as "protected" and + * a valid subscription key is required for a request to an API included in + * the product to succeed. If false, the product is referred to as "open" + * and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product + * it's value is assumed to be true. + */ + @JsonProperty(value = "properties.subscriptionRequired") + private Boolean subscriptionRequired; + + /* + * whether subscription approval is required. If false, new subscriptions + * will be approved automatically enabling developers to call the product’s + * APIs immediately after subscribing. If true, administrators must + * manually approve the subscription before the developer can any of the + * product’s APIs. Can be present only if subscriptionRequired property is + * present and has a value of false. + */ + @JsonProperty(value = "properties.approvalRequired") + private Boolean approvalRequired; + + /* + * Whether the number of subscriptions a user can have to this product at + * the same time. Set to null or omit to allow unlimited per user + * subscriptions. Can be present only if subscriptionRequired property is + * present and has a value of false. + */ + @JsonProperty(value = "properties.subscriptionsLimit") + private Integer subscriptionsLimit; + + /* + * whether product is published or not. Published products are discoverable + * by users of developer portal. Non published products are visible only to + * administrators. Default state of Product is notPublished. + */ + @JsonProperty(value = "properties.state") + private ProductState state; + + /* + * Product name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get the description property: Product description. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Product description. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the terms property: Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * + * @return the terms value. + */ + public String terms() { + return this.terms; + } + + /** + * Set the terms property: Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * + * @param terms the terms value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withTerms(String terms) { + this.terms = terms; + return this; + } + + /** + * Get the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Get the approvalRequired property: whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @return the approvalRequired value. + */ + public Boolean approvalRequired() { + return this.approvalRequired; + } + + /** + * Set the approvalRequired property: whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @param approvalRequired the approvalRequired value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withApprovalRequired(Boolean approvalRequired) { + this.approvalRequired = approvalRequired; + return this; + } + + /** + * Get the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @return the subscriptionsLimit value. + */ + public Integer subscriptionsLimit() { + return this.subscriptionsLimit; + } + + /** + * Set the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @param subscriptionsLimit the subscriptionsLimit value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withSubscriptionsLimit(Integer subscriptionsLimit) { + this.subscriptionsLimit = subscriptionsLimit; + return this; + } + + /** + * Get the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @return the state value. + */ + public ProductState state() { + return this.state; + } + + /** + * Set the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @param state the state value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withState(ProductState state) { + this.state = state; + return this; + } + + /** + * Get the displayName property: Product name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Product name. + * + * @param displayName the displayName value to set. + * @return the ProductContractInner object itself. + */ + public ProductContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterCollectionInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterCollectionInner.java new file mode 100644 index 0000000000000..c2b88b32a097c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterCollectionInner.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.apimanagement.fluent.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; + +/** Paged Quota Counter list representation. */ +@Fluent +public final class QuotaCounterCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaCounterCollectionInner.class); + + /* + * Quota counter values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Quota counter values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Quota counter values. + * + * @param value the value value to set. + * @return the QuotaCounterCollectionInner object itself. + */ + public QuotaCounterCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the QuotaCounterCollectionInner object itself. + */ + public QuotaCounterCollectionInner withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the QuotaCounterCollectionInner object itself. + */ + public QuotaCounterCollectionInner 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterContractInner.java new file mode 100644 index 0000000000000..c3f825935ef10 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/QuotaCounterContractInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueContractProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Quota counter details. */ +@Fluent +public final class QuotaCounterContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaCounterContractInner.class); + + /* + * The Key value of the Counter. Must not be empty. + */ + @JsonProperty(value = "counterKey", required = true) + private String counterKey; + + /* + * Identifier of the Period for which the counter was collected. Must not + * be empty. + */ + @JsonProperty(value = "periodKey", required = true) + private String periodKey; + + /* + * The date of the start of Counter Period. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + */ + @JsonProperty(value = "periodStartTime", required = true) + private OffsetDateTime periodStartTime; + + /* + * The date of the end of Counter Period. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + */ + @JsonProperty(value = "periodEndTime", required = true) + private OffsetDateTime periodEndTime; + + /* + * Quota Value Properties + */ + @JsonProperty(value = "value") + private QuotaCounterValueContractProperties value; + + /** + * Get the counterKey property: The Key value of the Counter. Must not be empty. + * + * @return the counterKey value. + */ + public String counterKey() { + return this.counterKey; + } + + /** + * Set the counterKey property: The Key value of the Counter. Must not be empty. + * + * @param counterKey the counterKey value to set. + * @return the QuotaCounterContractInner object itself. + */ + public QuotaCounterContractInner withCounterKey(String counterKey) { + this.counterKey = counterKey; + return this; + } + + /** + * Get the periodKey property: Identifier of the Period for which the counter was collected. Must not be empty. + * + * @return the periodKey value. + */ + public String periodKey() { + return this.periodKey; + } + + /** + * Set the periodKey property: Identifier of the Period for which the counter was collected. Must not be empty. + * + * @param periodKey the periodKey value to set. + * @return the QuotaCounterContractInner object itself. + */ + public QuotaCounterContractInner withPeriodKey(String periodKey) { + this.periodKey = periodKey; + return this; + } + + /** + * Get the periodStartTime property: The date of the start of Counter Period. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the periodStartTime value. + */ + public OffsetDateTime periodStartTime() { + return this.periodStartTime; + } + + /** + * Set the periodStartTime property: The date of the start of Counter Period. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param periodStartTime the periodStartTime value to set. + * @return the QuotaCounterContractInner object itself. + */ + public QuotaCounterContractInner withPeriodStartTime(OffsetDateTime periodStartTime) { + this.periodStartTime = periodStartTime; + return this; + } + + /** + * Get the periodEndTime property: The date of the end of Counter Period. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the periodEndTime value. + */ + public OffsetDateTime periodEndTime() { + return this.periodEndTime; + } + + /** + * Set the periodEndTime property: The date of the end of Counter Period. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param periodEndTime the periodEndTime value to set. + * @return the QuotaCounterContractInner object itself. + */ + public QuotaCounterContractInner withPeriodEndTime(OffsetDateTime periodEndTime) { + this.periodEndTime = periodEndTime; + return this; + } + + /** + * Get the value property: Quota Value Properties. + * + * @return the value value. + */ + public QuotaCounterValueContractProperties value() { + return this.value; + } + + /** + * Set the value property: Quota Value Properties. + * + * @param value the value value to set. + * @return the QuotaCounterContractInner object itself. + */ + public QuotaCounterContractInner withValue(QuotaCounterValueContractProperties value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (counterKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property counterKey in model QuotaCounterContractInner")); + } + if (periodKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property periodKey in model QuotaCounterContractInner")); + } + if (periodStartTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property periodStartTime in model QuotaCounterContractInner")); + } + if (periodEndTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property periodEndTime in model QuotaCounterContractInner")); + } + if (value() != null) { + value().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailCollectionInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailCollectionInner.java new file mode 100644 index 0000000000000..397e6846b7fc3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailCollectionInner.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.apimanagement.fluent.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; + +/** Paged Recipient User list representation. */ +@Fluent +public final class RecipientEmailCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecipientEmailCollectionInner.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the RecipientEmailCollectionInner object itself. + */ + public RecipientEmailCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the RecipientEmailCollectionInner object itself. + */ + public RecipientEmailCollectionInner withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the RecipientEmailCollectionInner object itself. + */ + public RecipientEmailCollectionInner 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailContractInner.java new file mode 100644 index 0000000000000..1e3c03f049cae --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientEmailContractInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recipient Email details. */ +@JsonFlatten +@Fluent +public class RecipientEmailContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecipientEmailContractInner.class); + + /* + * User Email subscribed to notification. + */ + @JsonProperty(value = "properties.email") + private String email; + + /** + * Get the email property: User Email subscribed to notification. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: User Email subscribed to notification. + * + * @param email the email value to set. + * @return the RecipientEmailContractInner object itself. + */ + public RecipientEmailContractInner withEmail(String email) { + this.email = email; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserCollectionInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserCollectionInner.java new file mode 100644 index 0000000000000..0a64e9fcc0639 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserCollectionInner.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.apimanagement.fluent.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; + +/** Paged Recipient User list representation. */ +@Fluent +public final class RecipientUserCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecipientUserCollectionInner.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the RecipientUserCollectionInner object itself. + */ + public RecipientUserCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the RecipientUserCollectionInner object itself. + */ + public RecipientUserCollectionInner withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the RecipientUserCollectionInner object itself. + */ + public RecipientUserCollectionInner 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserContractInner.java new file mode 100644 index 0000000000000..7b01d50e46d80 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RecipientUserContractInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recipient User details. */ +@JsonFlatten +@Fluent +public class RecipientUserContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecipientUserContractInner.class); + + /* + * API Management UserId subscribed to notification. + */ + @JsonProperty(value = "properties.userId") + private String userId; + + /** + * Get the userId property: API Management UserId subscribed to notification. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: API Management UserId subscribed to notification. + * + * @param userId the userId value to set. + * @return the RecipientUserContractInner object itself. + */ + public RecipientUserContractInner withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RegionContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RegionContractInner.java new file mode 100644 index 0000000000000..337342b12bee2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RegionContractInner.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.apimanagement.fluent.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; + +/** Region profile. */ +@Fluent +public final class RegionContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionContractInner.class); + + /* + * Region name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * whether Region is the master region. + */ + @JsonProperty(value = "isMasterRegion") + private Boolean isMasterRegion; + + /* + * whether Region is deleted. + */ + @JsonProperty(value = "isDeleted") + private Boolean isDeleted; + + /** + * Get the name property: Region name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isMasterRegion property: whether Region is the master region. + * + * @return the isMasterRegion value. + */ + public Boolean isMasterRegion() { + return this.isMasterRegion; + } + + /** + * Set the isMasterRegion property: whether Region is the master region. + * + * @param isMasterRegion the isMasterRegion value to set. + * @return the RegionContractInner object itself. + */ + public RegionContractInner withIsMasterRegion(Boolean isMasterRegion) { + this.isMasterRegion = isMasterRegion; + return this; + } + + /** + * Get the isDeleted property: whether Region is deleted. + * + * @return the isDeleted value. + */ + public Boolean isDeleted() { + return this.isDeleted; + } + + /** + * Set the isDeleted property: whether Region is deleted. + * + * @param isDeleted the isDeleted value to set. + * @return the RegionContractInner object itself. + */ + public RegionContractInner withIsDeleted(Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ReportRecordContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ReportRecordContractInner.java new file mode 100644 index 0000000000000..5a68a8a852019 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ReportRecordContractInner.java @@ -0,0 +1,700 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Report data. */ +@Fluent +public final class ReportRecordContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReportRecordContractInner.class); + + /* + * Name depending on report endpoint specifies product, API, operation or + * developer name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Start of aggregation period. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * Length of aggregation period. Interval must be multiple of 15 minutes + * and may not be zero. The value should be in ISO 8601 format + * (http://en.wikipedia.org/wiki/ISO_8601#Durations). + */ + @JsonProperty(value = "interval") + private String interval; + + /* + * Country to which this record data is related. + */ + @JsonProperty(value = "country") + private String country; + + /* + * Country region to which this record data is related. + */ + @JsonProperty(value = "region") + private String region; + + /* + * Zip code to which this record data is related. + */ + @JsonProperty(value = "zip") + private String zip; + + /* + * User identifier path. /users/{userId} + */ + @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY) + private String userId; + + /* + * Product identifier path. /products/{productId} + */ + @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /* + * API identifier path. /apis/{apiId} + */ + @JsonProperty(value = "apiId") + private String apiId; + + /* + * Operation identifier path. /apis/{apiId}/operations/{operationId} + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * API region identifier. + */ + @JsonProperty(value = "apiRegion") + private String apiRegion; + + /* + * Subscription identifier path. /subscriptions/{subscriptionId} + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * Number of successful calls. This includes calls returning HttpStatusCode + * <= 301 and HttpStatusCode.NotModified and + * HttpStatusCode.TemporaryRedirect + */ + @JsonProperty(value = "callCountSuccess") + private Integer callCountSuccess; + + /* + * Number of calls blocked due to invalid credentials. This includes calls + * returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and + * HttpStatusCode.TooManyRequests + */ + @JsonProperty(value = "callCountBlocked") + private Integer callCountBlocked; + + /* + * Number of calls failed due to proxy or backend errors. This includes + * calls returning HttpStatusCode.BadRequest(400) and any Code between + * HttpStatusCode.InternalServerError (500) and 600 + */ + @JsonProperty(value = "callCountFailed") + private Integer callCountFailed; + + /* + * Number of other calls. + */ + @JsonProperty(value = "callCountOther") + private Integer callCountOther; + + /* + * Total number of calls. + */ + @JsonProperty(value = "callCountTotal") + private Integer callCountTotal; + + /* + * Bandwidth consumed. + */ + @JsonProperty(value = "bandwidth") + private Long bandwidth; + + /* + * Number of times when content was served from cache policy. + */ + @JsonProperty(value = "cacheHitCount") + private Integer cacheHitCount; + + /* + * Number of times content was fetched from backend. + */ + @JsonProperty(value = "cacheMissCount") + private Integer cacheMissCount; + + /* + * Average time it took to process request. + */ + @JsonProperty(value = "apiTimeAvg") + private Double apiTimeAvg; + + /* + * Minimum time it took to process request. + */ + @JsonProperty(value = "apiTimeMin") + private Double apiTimeMin; + + /* + * Maximum time it took to process request. + */ + @JsonProperty(value = "apiTimeMax") + private Double apiTimeMax; + + /* + * Average time it took to process request on backend. + */ + @JsonProperty(value = "serviceTimeAvg") + private Double serviceTimeAvg; + + /* + * Minimum time it took to process request on backend. + */ + @JsonProperty(value = "serviceTimeMin") + private Double serviceTimeMin; + + /* + * Maximum time it took to process request on backend. + */ + @JsonProperty(value = "serviceTimeMax") + private Double serviceTimeMax; + + /** + * Get the name property: Name depending on report endpoint specifies product, API, operation or developer name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name depending on report endpoint specifies product, API, operation or developer name. + * + * @param name the name value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the timestamp property: Start of aggregation period. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: Start of aggregation period. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param timestamp the timestamp value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the interval property: Length of aggregation period. Interval must be multiple of 15 minutes and may not be + * zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + * + * @return the interval value. + */ + public String interval() { + return this.interval; + } + + /** + * Set the interval property: Length of aggregation period. Interval must be multiple of 15 minutes and may not be + * zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + * + * @param interval the interval value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withInterval(String interval) { + this.interval = interval; + return this; + } + + /** + * Get the country property: Country to which this record data is related. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: Country to which this record data is related. + * + * @param country the country value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the region property: Country region to which this record data is related. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Country region to which this record data is related. + * + * @param region the region value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the zip property: Zip code to which this record data is related. + * + * @return the zip value. + */ + public String zip() { + return this.zip; + } + + /** + * Set the zip property: Zip code to which this record data is related. + * + * @param zip the zip value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withZip(String zip) { + this.zip = zip; + return this; + } + + /** + * Get the userId property: User identifier path. /users/{userId}. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Get the productId property: Product identifier path. /products/{productId}. + * + * @return the productId value. + */ + public String productId() { + return this.productId; + } + + /** + * Get the apiId property: API identifier path. /apis/{apiId}. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: API identifier path. /apis/{apiId}. + * + * @param apiId the apiId value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Get the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}. + * + * @param operationId the operationId value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the apiRegion property: API region identifier. + * + * @return the apiRegion value. + */ + public String apiRegion() { + return this.apiRegion; + } + + /** + * Set the apiRegion property: API region identifier. + * + * @param apiRegion the apiRegion value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withApiRegion(String apiRegion) { + this.apiRegion = apiRegion; + return this; + } + + /** + * Get the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}. + * + * @param subscriptionId the subscriptionId value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the callCountSuccess property: Number of successful calls. This includes calls returning HttpStatusCode <= + * 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect. + * + * @return the callCountSuccess value. + */ + public Integer callCountSuccess() { + return this.callCountSuccess; + } + + /** + * Set the callCountSuccess property: Number of successful calls. This includes calls returning HttpStatusCode <= + * 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect. + * + * @param callCountSuccess the callCountSuccess value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCallCountSuccess(Integer callCountSuccess) { + this.callCountSuccess = callCountSuccess; + return this; + } + + /** + * Get the callCountBlocked property: Number of calls blocked due to invalid credentials. This includes calls + * returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests. + * + * @return the callCountBlocked value. + */ + public Integer callCountBlocked() { + return this.callCountBlocked; + } + + /** + * Set the callCountBlocked property: Number of calls blocked due to invalid credentials. This includes calls + * returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests. + * + * @param callCountBlocked the callCountBlocked value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCallCountBlocked(Integer callCountBlocked) { + this.callCountBlocked = callCountBlocked; + return this; + } + + /** + * Get the callCountFailed property: Number of calls failed due to proxy or backend errors. This includes calls + * returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600. + * + * @return the callCountFailed value. + */ + public Integer callCountFailed() { + return this.callCountFailed; + } + + /** + * Set the callCountFailed property: Number of calls failed due to proxy or backend errors. This includes calls + * returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600. + * + * @param callCountFailed the callCountFailed value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCallCountFailed(Integer callCountFailed) { + this.callCountFailed = callCountFailed; + return this; + } + + /** + * Get the callCountOther property: Number of other calls. + * + * @return the callCountOther value. + */ + public Integer callCountOther() { + return this.callCountOther; + } + + /** + * Set the callCountOther property: Number of other calls. + * + * @param callCountOther the callCountOther value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCallCountOther(Integer callCountOther) { + this.callCountOther = callCountOther; + return this; + } + + /** + * Get the callCountTotal property: Total number of calls. + * + * @return the callCountTotal value. + */ + public Integer callCountTotal() { + return this.callCountTotal; + } + + /** + * Set the callCountTotal property: Total number of calls. + * + * @param callCountTotal the callCountTotal value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCallCountTotal(Integer callCountTotal) { + this.callCountTotal = callCountTotal; + return this; + } + + /** + * Get the bandwidth property: Bandwidth consumed. + * + * @return the bandwidth value. + */ + public Long bandwidth() { + return this.bandwidth; + } + + /** + * Set the bandwidth property: Bandwidth consumed. + * + * @param bandwidth the bandwidth value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withBandwidth(Long bandwidth) { + this.bandwidth = bandwidth; + return this; + } + + /** + * Get the cacheHitCount property: Number of times when content was served from cache policy. + * + * @return the cacheHitCount value. + */ + public Integer cacheHitCount() { + return this.cacheHitCount; + } + + /** + * Set the cacheHitCount property: Number of times when content was served from cache policy. + * + * @param cacheHitCount the cacheHitCount value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCacheHitCount(Integer cacheHitCount) { + this.cacheHitCount = cacheHitCount; + return this; + } + + /** + * Get the cacheMissCount property: Number of times content was fetched from backend. + * + * @return the cacheMissCount value. + */ + public Integer cacheMissCount() { + return this.cacheMissCount; + } + + /** + * Set the cacheMissCount property: Number of times content was fetched from backend. + * + * @param cacheMissCount the cacheMissCount value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withCacheMissCount(Integer cacheMissCount) { + this.cacheMissCount = cacheMissCount; + return this; + } + + /** + * Get the apiTimeAvg property: Average time it took to process request. + * + * @return the apiTimeAvg value. + */ + public Double apiTimeAvg() { + return this.apiTimeAvg; + } + + /** + * Set the apiTimeAvg property: Average time it took to process request. + * + * @param apiTimeAvg the apiTimeAvg value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withApiTimeAvg(Double apiTimeAvg) { + this.apiTimeAvg = apiTimeAvg; + return this; + } + + /** + * Get the apiTimeMin property: Minimum time it took to process request. + * + * @return the apiTimeMin value. + */ + public Double apiTimeMin() { + return this.apiTimeMin; + } + + /** + * Set the apiTimeMin property: Minimum time it took to process request. + * + * @param apiTimeMin the apiTimeMin value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withApiTimeMin(Double apiTimeMin) { + this.apiTimeMin = apiTimeMin; + return this; + } + + /** + * Get the apiTimeMax property: Maximum time it took to process request. + * + * @return the apiTimeMax value. + */ + public Double apiTimeMax() { + return this.apiTimeMax; + } + + /** + * Set the apiTimeMax property: Maximum time it took to process request. + * + * @param apiTimeMax the apiTimeMax value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withApiTimeMax(Double apiTimeMax) { + this.apiTimeMax = apiTimeMax; + return this; + } + + /** + * Get the serviceTimeAvg property: Average time it took to process request on backend. + * + * @return the serviceTimeAvg value. + */ + public Double serviceTimeAvg() { + return this.serviceTimeAvg; + } + + /** + * Set the serviceTimeAvg property: Average time it took to process request on backend. + * + * @param serviceTimeAvg the serviceTimeAvg value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withServiceTimeAvg(Double serviceTimeAvg) { + this.serviceTimeAvg = serviceTimeAvg; + return this; + } + + /** + * Get the serviceTimeMin property: Minimum time it took to process request on backend. + * + * @return the serviceTimeMin value. + */ + public Double serviceTimeMin() { + return this.serviceTimeMin; + } + + /** + * Set the serviceTimeMin property: Minimum time it took to process request on backend. + * + * @param serviceTimeMin the serviceTimeMin value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withServiceTimeMin(Double serviceTimeMin) { + this.serviceTimeMin = serviceTimeMin; + return this; + } + + /** + * Get the serviceTimeMax property: Maximum time it took to process request on backend. + * + * @return the serviceTimeMax value. + */ + public Double serviceTimeMax() { + return this.serviceTimeMax; + } + + /** + * Set the serviceTimeMax property: Maximum time it took to process request on backend. + * + * @param serviceTimeMax the serviceTimeMax value to set. + * @return the ReportRecordContractInner object itself. + */ + public ReportRecordContractInner withServiceTimeMax(Double serviceTimeMax) { + this.serviceTimeMax = serviceTimeMax; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RequestReportRecordContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RequestReportRecordContractInner.java new file mode 100644 index 0000000000000..63341cfebef45 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/RequestReportRecordContractInner.java @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Request Report data. */ +@Fluent +public final class RequestReportRecordContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestReportRecordContractInner.class); + + /* + * API identifier path. /apis/{apiId} + */ + @JsonProperty(value = "apiId") + private String apiId; + + /* + * Operation identifier path. /apis/{apiId}/operations/{operationId} + */ + @JsonProperty(value = "operationId") + private String operationId; + + /* + * Product identifier path. /products/{productId} + */ + @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /* + * User identifier path. /users/{userId} + */ + @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY) + private String userId; + + /* + * The HTTP method associated with this request.. + */ + @JsonProperty(value = "method") + private String method; + + /* + * The full URL associated with this request. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The client IP address associated with this request. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The HTTP status code received by the gateway as a result of forwarding + * this request to the backend. + */ + @JsonProperty(value = "backendResponseCode") + private String backendResponseCode; + + /* + * The HTTP status code returned by the gateway. + */ + @JsonProperty(value = "responseCode") + private Integer responseCode; + + /* + * The size of the response returned by the gateway. + */ + @JsonProperty(value = "responseSize") + private Integer responseSize; + + /* + * The date and time when this request was received by the gateway in ISO + * 8601 format. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * Specifies if response cache was involved in generating the response. If + * the value is none, the cache was not used. If the value is hit, cached + * response was returned. If the value is miss, the cache was used but + * lookup resulted in a miss and request was fulfilled by the backend. + */ + @JsonProperty(value = "cache") + private String cache; + + /* + * The total time it took to process this request. + */ + @JsonProperty(value = "apiTime") + private Double apiTime; + + /* + * he time it took to forward this request to the backend and get the + * response back. + */ + @JsonProperty(value = "serviceTime") + private Double serviceTime; + + /* + * Azure region where the gateway that processed this request is located. + */ + @JsonProperty(value = "apiRegion") + private String apiRegion; + + /* + * Subscription identifier path. /subscriptions/{subscriptionId} + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * Request Identifier. + */ + @JsonProperty(value = "requestId") + private String requestId; + + /* + * The size of this request.. + */ + @JsonProperty(value = "requestSize") + private Integer requestSize; + + /** + * Get the apiId property: API identifier path. /apis/{apiId}. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: API identifier path. /apis/{apiId}. + * + * @param apiId the apiId value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Get the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}. + * + * @param operationId the operationId value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Get the productId property: Product identifier path. /products/{productId}. + * + * @return the productId value. + */ + public String productId() { + return this.productId; + } + + /** + * Get the userId property: User identifier path. /users/{userId}. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Get the method property: The HTTP method associated with this request.. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: The HTTP method associated with this request.. + * + * @param method the method value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the url property: The full URL associated with this request. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The full URL associated with this request. + * + * @param url the url value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the ipAddress property: The client IP address associated with this request. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The client IP address associated with this request. + * + * @param ipAddress the ipAddress value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the backendResponseCode property: The HTTP status code received by the gateway as a result of forwarding this + * request to the backend. + * + * @return the backendResponseCode value. + */ + public String backendResponseCode() { + return this.backendResponseCode; + } + + /** + * Set the backendResponseCode property: The HTTP status code received by the gateway as a result of forwarding this + * request to the backend. + * + * @param backendResponseCode the backendResponseCode value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withBackendResponseCode(String backendResponseCode) { + this.backendResponseCode = backendResponseCode; + return this; + } + + /** + * Get the responseCode property: The HTTP status code returned by the gateway. + * + * @return the responseCode value. + */ + public Integer responseCode() { + return this.responseCode; + } + + /** + * Set the responseCode property: The HTTP status code returned by the gateway. + * + * @param responseCode the responseCode value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withResponseCode(Integer responseCode) { + this.responseCode = responseCode; + return this; + } + + /** + * Get the responseSize property: The size of the response returned by the gateway. + * + * @return the responseSize value. + */ + public Integer responseSize() { + return this.responseSize; + } + + /** + * Set the responseSize property: The size of the response returned by the gateway. + * + * @param responseSize the responseSize value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withResponseSize(Integer responseSize) { + this.responseSize = responseSize; + return this; + } + + /** + * Get the timestamp property: The date and time when this request was received by the gateway in ISO 8601 format. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The date and time when this request was received by the gateway in ISO 8601 format. + * + * @param timestamp the timestamp value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the cache property: Specifies if response cache was involved in generating the response. If the value is + * none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache + * was used but lookup resulted in a miss and request was fulfilled by the backend. + * + * @return the cache value. + */ + public String cache() { + return this.cache; + } + + /** + * Set the cache property: Specifies if response cache was involved in generating the response. If the value is + * none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache + * was used but lookup resulted in a miss and request was fulfilled by the backend. + * + * @param cache the cache value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withCache(String cache) { + this.cache = cache; + return this; + } + + /** + * Get the apiTime property: The total time it took to process this request. + * + * @return the apiTime value. + */ + public Double apiTime() { + return this.apiTime; + } + + /** + * Set the apiTime property: The total time it took to process this request. + * + * @param apiTime the apiTime value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withApiTime(Double apiTime) { + this.apiTime = apiTime; + return this; + } + + /** + * Get the serviceTime property: he time it took to forward this request to the backend and get the response back. + * + * @return the serviceTime value. + */ + public Double serviceTime() { + return this.serviceTime; + } + + /** + * Set the serviceTime property: he time it took to forward this request to the backend and get the response back. + * + * @param serviceTime the serviceTime value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withServiceTime(Double serviceTime) { + this.serviceTime = serviceTime; + return this; + } + + /** + * Get the apiRegion property: Azure region where the gateway that processed this request is located. + * + * @return the apiRegion value. + */ + public String apiRegion() { + return this.apiRegion; + } + + /** + * Set the apiRegion property: Azure region where the gateway that processed this request is located. + * + * @param apiRegion the apiRegion value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withApiRegion(String apiRegion) { + this.apiRegion = apiRegion; + return this; + } + + /** + * Get the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}. + * + * @param subscriptionId the subscriptionId value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the requestId property: Request Identifier. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: Request Identifier. + * + * @param requestId the requestId value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the requestSize property: The size of this request.. + * + * @return the requestSize value. + */ + public Integer requestSize() { + return this.requestSize; + } + + /** + * Set the requestSize property: The size of this request.. + * + * @param requestSize the requestSize value to set. + * @return the RequestReportRecordContractInner object itself. + */ + public RequestReportRecordContractInner withRequestSize(Integer requestSize) { + this.requestSize = requestSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ResourceSkuResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ResourceSkuResultInner.java new file mode 100644 index 0000000000000..70e1da11fdb08 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/ResourceSkuResultInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.ResourceSku; +import com.azure.resourcemanager.apimanagement.models.ResourceSkuCapacity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an available API Management service SKU. */ +@Immutable +public final class ResourceSkuResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuResultInner.class); + + /* + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * Specifies API Management SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSku sku; + + /* + * Specifies the number of API Management units. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacity capacity; + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the sku property: Specifies API Management SKU. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Get the capacity property: Specifies the number of API Management units. + * + * @return the capacity value. + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (capacity() != null) { + capacity().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SchemaContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SchemaContractInner.java new file mode 100644 index 0000000000000..aee0bb8c7dff2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SchemaContractInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Schema Contract details. */ +@JsonFlatten +@Fluent +public class SchemaContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaContractInner.class); + + /* + * Must be a valid a media type used in a Content-Type header as defined in + * the RFC 2616. Media type of the schema document (e.g. application/json, + * application/xml).
- `Swagger` Schema use + * `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` + * Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` + * Schema use `application/vnd.oai.openapi.components+json`
- `WADL + * Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. + */ + @JsonProperty(value = "properties.contentType") + private String contentType; + + /* + * Json escaped string defining the document representing the Schema. Used + * for schemas other than Swagger/OpenAPI. + */ + @JsonProperty(value = "properties.document.value") + private String value; + + /* + * Types definitions. Used for Swagger/OpenAPI schemas only, null + * otherwise. + */ + @JsonProperty(value = "properties.document.definitions") + private Object definitions; + + /** + * Get the contentType property: Must be a valid a media type used in a Content-Type header as defined in the RFC + * 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema + * use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use + * `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Must be a valid a media type used in a Content-Type header as defined in the RFC + * 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema + * use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use + * `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`. + * + * @param contentType the contentType value to set. + * @return the SchemaContractInner object itself. + */ + public SchemaContractInner withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the value property: Json escaped string defining the document representing the Schema. Used for schemas other + * than Swagger/OpenAPI. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Json escaped string defining the document representing the Schema. Used for schemas other + * than Swagger/OpenAPI. + * + * @param value the value value to set. + * @return the SchemaContractInner object itself. + */ + public SchemaContractInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the definitions property: Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + * + * @return the definitions value. + */ + public Object definitions() { + return this.definitions; + } + + /** + * Set the definitions property: Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + * + * @param definitions the definitions value to set. + * @return the SchemaContractInner object itself. + */ + public SchemaContractInner withDefinitions(Object definitions) { + this.definitions = definitions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionContractInner.java new file mode 100644 index 0000000000000..502365aa0675d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionContractInner.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.SubscriptionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Subscription details. */ +@JsonFlatten +@Fluent +public class SubscriptionContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionContractInner.class); + + /* + * The user resource identifier of the subscription owner. The value is a + * valid relative URL in the format of /users/{userId} where {userId} is a + * user identifier. + */ + @JsonProperty(value = "properties.ownerId") + private String ownerId; + + /* + * Scope like /products/{productId} or /apis or /apis/{apiId}. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /* + * The name of the subscription, or null if the subscription has no name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Subscription state. Possible states are * active – the subscription is + * active, * suspended – the subscription is blocked, and the subscriber + * cannot call any APIs of the product, * submitted – the subscription + * request has been made by the developer, but has not yet been approved or + * rejected, * rejected – the subscription request has been denied by an + * administrator, * cancelled – the subscription has been cancelled by the + * developer or administrator, * expired – the subscription reached its + * expiration date and was deactivated. + */ + @JsonProperty(value = "properties.state") + private SubscriptionState state; + + /* + * Subscription creation date. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * Subscription activation date. The setting is for audit purposes only and + * the subscription is not automatically activated. The subscription + * lifecycle can be managed by using the `state` property. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + * the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.startDate") + private OffsetDateTime startDate; + + /* + * Subscription expiration date. The setting is for audit purposes only and + * the subscription is not automatically expired. The subscription + * lifecycle can be managed by using the `state` property. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + * the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.expirationDate") + private OffsetDateTime expirationDate; + + /* + * Date when subscription was cancelled or expired. The setting is for + * audit purposes only and the subscription is not automatically cancelled. + * The subscription lifecycle can be managed by using the `state` property. + * The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as + * specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.endDate") + private OffsetDateTime endDate; + + /* + * Upcoming subscription expiration notification date. The date conforms to + * the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + * 8601 standard. + * + */ + @JsonProperty(value = "properties.notificationDate") + private OffsetDateTime notificationDate; + + /* + * Subscription primary key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "properties.primaryKey") + private String primaryKey; + + /* + * Subscription secondary key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "properties.secondaryKey") + private String secondaryKey; + + /* + * Optional subscription comment added by an administrator when the state + * is changed to the 'rejected'. + */ + @JsonProperty(value = "properties.stateComment") + private String stateComment; + + /* + * Determines whether tracing is enabled + */ + @JsonProperty(value = "properties.allowTracing") + private Boolean allowTracing; + + /** + * Get the ownerId property: The user resource identifier of the subscription owner. The value is a valid relative + * URL in the format of /users/{userId} where {userId} is a user identifier. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: The user resource identifier of the subscription owner. The value is a valid relative + * URL in the format of /users/{userId} where {userId} is a user identifier. + * + * @param ownerId the ownerId value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @param scope the scope value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the displayName property: The name of the subscription, or null if the subscription has no name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The name of the subscription, or null if the subscription has no name. + * + * @param displayName the displayName value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the state property: Subscription state. Possible states are * active – the subscription is active, * + * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – + * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – + * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled + * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + * + * @return the state value. + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Set the state property: Subscription state. Possible states are * active – the subscription is active, * + * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – + * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – + * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled + * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + * + * @param state the state value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withState(SubscriptionState state) { + this.state = state; + return this; + } + + /** + * Get the createdDate property: Subscription creation date. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the startDate property: Subscription activation date. The setting is for audit purposes only and the + * subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Set the startDate property: Subscription activation date. The setting is for audit purposes only and the + * subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @param startDate the startDate value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the + * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the + * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @param expirationDate the expirationDate value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the endDate property: Date when subscription was cancelled or expired. The setting is for audit purposes only + * and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the + * `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.endDate; + } + + /** + * Set the endDate property: Date when subscription was cancelled or expired. The setting is for audit purposes only + * and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the + * `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @param endDate the endDate value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get the notificationDate property: Upcoming subscription expiration notification date. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the notificationDate value. + */ + public OffsetDateTime notificationDate() { + return this.notificationDate; + } + + /** + * Set the notificationDate property: Upcoming subscription expiration notification date. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param notificationDate the notificationDate value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withNotificationDate(OffsetDateTime notificationDate) { + this.notificationDate = notificationDate; + return this; + } + + /** + * Get the primaryKey property: Subscription primary key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Subscription primary key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @param primaryKey the primaryKey value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Subscription secondary key. This property will not be filled on 'GET' operations! + * Use '/listSecrets' POST request to get the value. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Subscription secondary key. This property will not be filled on 'GET' operations! + * Use '/listSecrets' POST request to get the value. + * + * @param secondaryKey the secondaryKey value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the stateComment property: Optional subscription comment added by an administrator when the state is changed + * to the 'rejected'. + * + * @return the stateComment value. + */ + public String stateComment() { + return this.stateComment; + } + + /** + * Set the stateComment property: Optional subscription comment added by an administrator when the state is changed + * to the 'rejected'. + * + * @param stateComment the stateComment value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withStateComment(String stateComment) { + this.stateComment = stateComment; + return this; + } + + /** + * Get the allowTracing property: Determines whether tracing is enabled. + * + * @return the allowTracing value. + */ + public Boolean allowTracing() { + return this.allowTracing; + } + + /** + * Set the allowTracing property: Determines whether tracing is enabled. + * + * @param allowTracing the allowTracing value to set. + * @return the SubscriptionContractInner object itself. + */ + public SubscriptionContractInner withAllowTracing(Boolean allowTracing) { + this.allowTracing = allowTracing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionKeysContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionKeysContractInner.java new file mode 100644 index 0000000000000..321253b421218 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/SubscriptionKeysContractInner.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.apimanagement.fluent.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; + +/** Subscription keys. */ +@Fluent +public final class SubscriptionKeysContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionKeysContractInner.class); + + /* + * Subscription primary key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * Subscription secondary key. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /** + * Get the primaryKey property: Subscription primary key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Subscription primary key. + * + * @param primaryKey the primaryKey value to set. + * @return the SubscriptionKeysContractInner object itself. + */ + public SubscriptionKeysContractInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Subscription secondary key. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Subscription secondary key. + * + * @param secondaryKey the secondaryKey value to set. + * @return the SubscriptionKeysContractInner object itself. + */ + public SubscriptionKeysContractInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagContractInner.java new file mode 100644 index 0000000000000..61bd2ad1f8e55 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagContractInner.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tag Contract details. */ +@JsonFlatten +@Fluent +public class TagContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagContractInner.class); + + /* + * Tag name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get the displayName property: Tag name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Tag name. + * + * @param displayName the displayName value to set. + * @return the TagContractInner object itself. + */ + public TagContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagDescriptionContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagDescriptionContractInner.java new file mode 100644 index 0000000000000..ed30f4bce3b27 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagDescriptionContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contract details. */ +@JsonFlatten +@Fluent +public class TagDescriptionContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagDescriptionContractInner.class); + + /* + * Description of the Tag. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Absolute URL of external resources describing the tag. + */ + @JsonProperty(value = "properties.externalDocsUrl") + private String externalDocsUrl; + + /* + * Description of the external resources describing the tag. + */ + @JsonProperty(value = "properties.externalDocsDescription") + private String externalDocsDescription; + + /* + * Identifier of the tag in the form of /tags/{tagId} + */ + @JsonProperty(value = "properties.tagId") + private String tagId; + + /* + * Tag name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get the description property: Description of the Tag. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the Tag. + * + * @param description the description value to set. + * @return the TagDescriptionContractInner object itself. + */ + public TagDescriptionContractInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @return the externalDocsUrl value. + */ + public String externalDocsUrl() { + return this.externalDocsUrl; + } + + /** + * Set the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @param externalDocsUrl the externalDocsUrl value to set. + * @return the TagDescriptionContractInner object itself. + */ + public TagDescriptionContractInner withExternalDocsUrl(String externalDocsUrl) { + this.externalDocsUrl = externalDocsUrl; + return this; + } + + /** + * Get the externalDocsDescription property: Description of the external resources describing the tag. + * + * @return the externalDocsDescription value. + */ + public String externalDocsDescription() { + return this.externalDocsDescription; + } + + /** + * Set the externalDocsDescription property: Description of the external resources describing the tag. + * + * @param externalDocsDescription the externalDocsDescription value to set. + * @return the TagDescriptionContractInner object itself. + */ + public TagDescriptionContractInner withExternalDocsDescription(String externalDocsDescription) { + this.externalDocsDescription = externalDocsDescription; + return this; + } + + /** + * Get the tagId property: Identifier of the tag in the form of /tags/{tagId}. + * + * @return the tagId value. + */ + public String tagId() { + return this.tagId; + } + + /** + * Set the tagId property: Identifier of the tag in the form of /tags/{tagId}. + * + * @param tagId the tagId value to set. + * @return the TagDescriptionContractInner object itself. + */ + public TagDescriptionContractInner withTagId(String tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get the displayName property: Tag name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Tag name. + * + * @param displayName the displayName value to set. + * @return the TagDescriptionContractInner object itself. + */ + public TagDescriptionContractInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagResourceContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagResourceContractInner.java new file mode 100644 index 0000000000000..5c1b95faffddc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TagResourceContractInner.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.models.ApiTagResourceContractProperties; +import com.azure.resourcemanager.apimanagement.models.OperationTagResourceContractProperties; +import com.azure.resourcemanager.apimanagement.models.ProductTagResourceContractProperties; +import com.azure.resourcemanager.apimanagement.models.TagResourceContractProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** TagResource contract properties. */ +@Fluent +public final class TagResourceContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagResourceContractInner.class); + + /* + * Tag associated with the resource. + */ + @JsonProperty(value = "tag", required = true) + private TagResourceContractProperties tag; + + /* + * Api associated with the tag. + */ + @JsonProperty(value = "api") + private ApiTagResourceContractProperties api; + + /* + * Operation associated with the tag. + */ + @JsonProperty(value = "operation") + private OperationTagResourceContractProperties operation; + + /* + * Product associated with the tag. + */ + @JsonProperty(value = "product") + private ProductTagResourceContractProperties product; + + /** + * Get the tag property: Tag associated with the resource. + * + * @return the tag value. + */ + public TagResourceContractProperties tag() { + return this.tag; + } + + /** + * Set the tag property: Tag associated with the resource. + * + * @param tag the tag value to set. + * @return the TagResourceContractInner object itself. + */ + public TagResourceContractInner withTag(TagResourceContractProperties tag) { + this.tag = tag; + return this; + } + + /** + * Get the api property: Api associated with the tag. + * + * @return the api value. + */ + public ApiTagResourceContractProperties api() { + return this.api; + } + + /** + * Set the api property: Api associated with the tag. + * + * @param api the api value to set. + * @return the TagResourceContractInner object itself. + */ + public TagResourceContractInner withApi(ApiTagResourceContractProperties api) { + this.api = api; + return this; + } + + /** + * Get the operation property: Operation associated with the tag. + * + * @return the operation value. + */ + public OperationTagResourceContractProperties operation() { + return this.operation; + } + + /** + * Set the operation property: Operation associated with the tag. + * + * @param operation the operation value to set. + * @return the TagResourceContractInner object itself. + */ + public TagResourceContractInner withOperation(OperationTagResourceContractProperties operation) { + this.operation = operation; + return this; + } + + /** + * Get the product property: Product associated with the tag. + * + * @return the product value. + */ + public ProductTagResourceContractProperties product() { + return this.product; + } + + /** + * Set the product property: Product associated with the tag. + * + * @param product the product value to set. + * @return the TagResourceContractInner object itself. + */ + public TagResourceContractInner withProduct(ProductTagResourceContractProperties product) { + this.product = product; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tag() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tag in model TagResourceContractInner")); + } else { + tag().validate(); + } + if (api() != null) { + api().validate(); + } + if (operation() != null) { + operation().validate(); + } + if (product() != null) { + product().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantConfigurationSyncStateContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantConfigurationSyncStateContractInner.java new file mode 100644 index 0000000000000..d7c909269d6e1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantConfigurationSyncStateContractInner.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.apimanagement.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Tenant Configuration Synchronization State. */ +@Fluent +public final class TenantConfigurationSyncStateContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantConfigurationSyncStateContractInner.class); + + /* + * The name of Git branch. + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * The latest commit Id. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /* + * value indicating if last sync was save (true) or deploy (false) + * operation. + */ + @JsonProperty(value = "isExport") + private Boolean isExport; + + /* + * value indicating if last synchronization was later than the + * configuration change. + */ + @JsonProperty(value = "isSynced") + private Boolean isSynced; + + /* + * value indicating whether Git configuration access is enabled. + */ + @JsonProperty(value = "isGitEnabled") + private Boolean isGitEnabled; + + /* + * The date of the latest synchronization. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + */ + @JsonProperty(value = "syncDate") + private OffsetDateTime syncDate; + + /* + * The date of the latest configuration change. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + */ + @JsonProperty(value = "configurationChangeDate") + private OffsetDateTime configurationChangeDate; + + /** + * Get the branch property: The name of Git branch. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The name of Git branch. + * + * @param branch the branch value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the commitId property: The latest commit Id. + * + * @return the commitId value. + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the commitId property: The latest commit Id. + * + * @param commitId the commitId value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Get the isExport property: value indicating if last sync was save (true) or deploy (false) operation. + * + * @return the isExport value. + */ + public Boolean isExport() { + return this.isExport; + } + + /** + * Set the isExport property: value indicating if last sync was save (true) or deploy (false) operation. + * + * @param isExport the isExport value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withIsExport(Boolean isExport) { + this.isExport = isExport; + return this; + } + + /** + * Get the isSynced property: value indicating if last synchronization was later than the configuration change. + * + * @return the isSynced value. + */ + public Boolean isSynced() { + return this.isSynced; + } + + /** + * Set the isSynced property: value indicating if last synchronization was later than the configuration change. + * + * @param isSynced the isSynced value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withIsSynced(Boolean isSynced) { + this.isSynced = isSynced; + return this; + } + + /** + * Get the isGitEnabled property: value indicating whether Git configuration access is enabled. + * + * @return the isGitEnabled value. + */ + public Boolean isGitEnabled() { + return this.isGitEnabled; + } + + /** + * Set the isGitEnabled property: value indicating whether Git configuration access is enabled. + * + * @param isGitEnabled the isGitEnabled value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withIsGitEnabled(Boolean isGitEnabled) { + this.isGitEnabled = isGitEnabled; + return this; + } + + /** + * Get the syncDate property: The date of the latest synchronization. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the syncDate value. + */ + public OffsetDateTime syncDate() { + return this.syncDate; + } + + /** + * Set the syncDate property: The date of the latest synchronization. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param syncDate the syncDate value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withSyncDate(OffsetDateTime syncDate) { + this.syncDate = syncDate; + return this; + } + + /** + * Get the configurationChangeDate property: The date of the latest configuration change. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the configurationChangeDate value. + */ + public OffsetDateTime configurationChangeDate() { + return this.configurationChangeDate; + } + + /** + * Set the configurationChangeDate property: The date of the latest configuration change. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param configurationChangeDate the configurationChangeDate value to set. + * @return the TenantConfigurationSyncStateContractInner object itself. + */ + public TenantConfigurationSyncStateContractInner withConfigurationChangeDate( + OffsetDateTime configurationChangeDate) { + this.configurationChangeDate = configurationChangeDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantSettingsContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantSettingsContractInner.java new file mode 100644 index 0000000000000..8b8882a73a428 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/TenantSettingsContractInner.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Tenant Settings. */ +@JsonFlatten +@Fluent +public class TenantSettingsContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantSettingsContractInner.class); + + /* + * Tenant settings + */ + @JsonProperty(value = "properties.settings") + private Map settings; + + /** + * Get the settings property: Tenant settings. + * + * @return the settings value. + */ + public Map settings() { + return this.settings; + } + + /** + * Set the settings property: Tenant settings. + * + * @param settings the settings value to set. + * @return the TenantSettingsContractInner object itself. + */ + public TenantSettingsContractInner withSettings(Map settings) { + this.settings = settings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserContractInner.java new file mode 100644 index 0000000000000..a2cb5d18679f8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserContractInner.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.models.GroupContractProperties; +import com.azure.resourcemanager.apimanagement.models.UserState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** User details. */ +@JsonFlatten +@Fluent +public class UserContractInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserContractInner.class); + + /* + * Account state. Specifies whether the user is active or not. Blocked + * users are unable to sign into the developer portal or call any APIs of + * subscribed products. Default state is Active. + */ + @JsonProperty(value = "properties.state") + private UserState state; + + /* + * Optional note about a user set by the administrator. + */ + @JsonProperty(value = "properties.note") + private String note; + + /* + * Collection of user identities. + */ + @JsonProperty(value = "properties.identities") + private List identities; + + /* + * First name. + */ + @JsonProperty(value = "properties.firstName") + private String firstName; + + /* + * Last name. + */ + @JsonProperty(value = "properties.lastName") + private String lastName; + + /* + * Email address. + */ + @JsonProperty(value = "properties.email") + private String email; + + /* + * Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.registrationDate") + private OffsetDateTime registrationDate; + + /* + * Collection of groups user is part of. + */ + @JsonProperty(value = "properties.groups", access = JsonProperty.Access.WRITE_ONLY) + private List groups; + + /** + * Get the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @return the state value. + */ + public UserState state() { + return this.state; + } + + /** + * Set the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @param state the state value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withState(UserState state) { + this.state = state; + return this; + } + + /** + * Get the note property: Optional note about a user set by the administrator. + * + * @return the note value. + */ + public String note() { + return this.note; + } + + /** + * Set the note property: Optional note about a user set by the administrator. + * + * @param note the note value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withNote(String note) { + this.note = note; + return this; + } + + /** + * Get the identities property: Collection of user identities. + * + * @return the identities value. + */ + public List identities() { + return this.identities; + } + + /** + * Set the identities property: Collection of user identities. + * + * @param identities the identities value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withIdentities(List identities) { + this.identities = identities; + return this; + } + + /** + * Get the firstName property: First name. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name. + * + * @param firstName the firstName value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name. + * + * @param lastName the lastName value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the email property: Email address. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address. + * + * @param email the email value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the registrationDate property: Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the registrationDate value. + */ + public OffsetDateTime registrationDate() { + return this.registrationDate; + } + + /** + * Set the registrationDate property: Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param registrationDate the registrationDate value to set. + * @return the UserContractInner object itself. + */ + public UserContractInner withRegistrationDate(OffsetDateTime registrationDate) { + this.registrationDate = registrationDate; + return this; + } + + /** + * Get the groups property: Collection of groups user is part of. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identities() != null) { + identities().forEach(e -> e.validate()); + } + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserIdentityContractInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserIdentityContractInner.java new file mode 100644 index 0000000000000..a434bc188e02c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserIdentityContractInner.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.apimanagement.fluent.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; + +/** User identity details. */ +@Fluent +public final class UserIdentityContractInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentityContractInner.class); + + /* + * Identity provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Identifier value within provider. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the provider property: Identity provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Identity provider name. + * + * @param provider the provider value to set. + * @return the UserIdentityContractInner object itself. + */ + public UserIdentityContractInner withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the id property: Identifier value within provider. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Identifier value within provider. + * + * @param id the id value to set. + * @return the UserIdentityContractInner object itself. + */ + public UserIdentityContractInner 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserTokenResultInner.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserTokenResultInner.java new file mode 100644 index 0000000000000..2fb9df74862aa --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/UserTokenResultInner.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.apimanagement.fluent.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; + +/** Get User Token response details. */ +@Fluent +public final class UserTokenResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserTokenResultInner.class); + + /* + * Shared Access Authorization token for the User. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: Shared Access Authorization token for the User. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Shared Access Authorization token for the User. + * + * @param value the value value to set. + * @return the UserTokenResultInner object itself. + */ + public UserTokenResultInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/package-info.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/models/package-info.java new file mode 100644 index 0000000000000..684ae8e24e53d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/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 ApiManagementClient. ApiManagement Client. */ +package com.azure.resourcemanager.apimanagement.fluent.models; diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/package-info.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/fluent/package-info.java new file mode 100644 index 0000000000000..fc4ae8637c7b1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/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 ApiManagementClient. ApiManagement Client. */ +package com.azure.resourcemanager.apimanagement.fluent; diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationContractImpl.java new file mode 100644 index 0000000000000..42dd7df3d359d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationContractImpl.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; +import com.azure.resourcemanager.apimanagement.models.AccessIdName; +import com.azure.resourcemanager.apimanagement.models.AccessInformationContract; +import com.azure.resourcemanager.apimanagement.models.AccessInformationCreateParameters; +import com.azure.resourcemanager.apimanagement.models.AccessInformationSecretsContract; +import com.azure.resourcemanager.apimanagement.models.AccessInformationUpdateParameters; + +public final class AccessInformationContractImpl + implements AccessInformationContract, AccessInformationContract.Definition, AccessInformationContract.Update { + private AccessInformationContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public AccessInformationContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private AccessIdName accessName; + + private String createIfMatch; + + private AccessInformationCreateParameters createParameters; + + private String updateIfMatch; + + private AccessInformationUpdateParameters updateParameters; + + public AccessInformationContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public AccessInformationContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getTenantAccess() + .createWithResponse( + resourceGroupName, serviceName, accessName, createIfMatch, createParameters, Context.NONE) + .getValue(); + return this; + } + + public AccessInformationContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTenantAccess() + .createWithResponse( + resourceGroupName, serviceName, accessName, createIfMatch, createParameters, context) + .getValue(); + return this; + } + + AccessInformationContractImpl( + AccessIdName name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new AccessInformationContractInner(); + this.serviceManager = serviceManager; + this.accessName = name; + this.createIfMatch = null; + this.createParameters = new AccessInformationCreateParameters(); + } + + public AccessInformationContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new AccessInformationUpdateParameters(); + return this; + } + + public AccessInformationContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTenantAccess() + .updateWithResponse( + resourceGroupName, serviceName, accessName, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public AccessInformationContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTenantAccess() + .updateWithResponse( + resourceGroupName, serviceName, accessName, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + AccessInformationContractImpl( + AccessInformationContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.accessName = AccessIdName.fromString(Utils.getValueFromIdByName(innerObject.id(), "tenant")); + } + + public AccessInformationContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTenantAccess() + .getWithResponse(resourceGroupName, serviceName, accessName, Context.NONE) + .getValue(); + return this; + } + + public AccessInformationContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTenantAccess() + .getWithResponse(resourceGroupName, serviceName, accessName, context) + .getValue(); + return this; + } + + public void regeneratePrimaryKey() { + serviceManager.tenantAccess().regeneratePrimaryKey(resourceGroupName, serviceName, accessName); + } + + public Response regeneratePrimaryKeyWithResponse(Context context) { + return serviceManager + .tenantAccess() + .regeneratePrimaryKeyWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public void regenerateSecondaryKey() { + serviceManager.tenantAccess().regenerateSecondaryKey(resourceGroupName, serviceName, accessName); + } + + public Response regenerateSecondaryKeyWithResponse(Context context) { + return serviceManager + .tenantAccess() + .regenerateSecondaryKeyWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public AccessInformationSecretsContract listSecrets() { + return serviceManager.tenantAccess().listSecrets(resourceGroupName, serviceName, accessName); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager + .tenantAccess() + .listSecretsWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public AccessInformationContractImpl withPrincipalId(String principalId) { + this.createParameters.withPrincipalId(principalId); + return this; + } + + public AccessInformationContractImpl withPrimaryKey(String primaryKey) { + this.createParameters.withPrimaryKey(primaryKey); + return this; + } + + public AccessInformationContractImpl withSecondaryKey(String secondaryKey) { + this.createParameters.withSecondaryKey(secondaryKey); + return this; + } + + public AccessInformationContractImpl withEnabled(Boolean enabled) { + if (isInCreateMode()) { + this.createParameters.withEnabled(enabled); + return this; + } else { + this.updateParameters.withEnabled(enabled); + return this; + } + } + + public AccessInformationContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationSecretsContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationSecretsContractImpl.java new file mode 100644 index 0000000000000..7dca548a69368 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AccessInformationSecretsContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AccessInformationSecretsContract; + +public final class AccessInformationSecretsContractImpl implements AccessInformationSecretsContract { + private AccessInformationSecretsContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + AccessInformationSecretsContractImpl( + AccessInformationSecretsContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public AccessInformationSecretsContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiContractImpl.java new file mode 100644 index 0000000000000..6b69a7f0908e3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiContractImpl.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiContract; +import com.azure.resourcemanager.apimanagement.models.ApiCreateOrUpdateParameter; +import com.azure.resourcemanager.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector; +import com.azure.resourcemanager.apimanagement.models.ApiType; +import com.azure.resourcemanager.apimanagement.models.ApiUpdateContract; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetContractDetails; +import com.azure.resourcemanager.apimanagement.models.AuthenticationSettingsContract; +import com.azure.resourcemanager.apimanagement.models.ContentFormat; +import com.azure.resourcemanager.apimanagement.models.Protocol; +import com.azure.resourcemanager.apimanagement.models.SoapApiType; +import com.azure.resourcemanager.apimanagement.models.SubscriptionKeyParameterNamesContract; +import java.util.Collections; +import java.util.List; + +public final class ApiContractImpl implements ApiContract, ApiContract.Definition, ApiContract.Update { + private ApiContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public AuthenticationSettingsContract authenticationSettings() { + return this.innerModel().authenticationSettings(); + } + + public SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames() { + return this.innerModel().subscriptionKeyParameterNames(); + } + + public ApiType apiType() { + return this.innerModel().apiType(); + } + + public String apiRevision() { + return this.innerModel().apiRevision(); + } + + public String apiVersion() { + return this.innerModel().apiVersion(); + } + + public Boolean isCurrent() { + return this.innerModel().isCurrent(); + } + + public Boolean isOnline() { + return this.innerModel().isOnline(); + } + + public String apiRevisionDescription() { + return this.innerModel().apiRevisionDescription(); + } + + public String apiVersionDescription() { + return this.innerModel().apiVersionDescription(); + } + + public String apiVersionSetId() { + return this.innerModel().apiVersionSetId(); + } + + public Boolean subscriptionRequired() { + return this.innerModel().subscriptionRequired(); + } + + public String sourceApiId() { + return this.innerModel().sourceApiId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String serviceUrl() { + return this.innerModel().serviceUrl(); + } + + public String path() { + return this.innerModel().path(); + } + + public List protocols() { + List inner = this.innerModel().protocols(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApiVersionSetContractDetails apiVersionSet() { + return this.innerModel().apiVersionSet(); + } + + public ApiContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String createIfMatch; + + private ApiCreateOrUpdateParameter createParameters; + + private String updateIfMatch; + + private ApiUpdateContract updateParameters; + + public ApiContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ApiContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApis() + .createOrUpdate(resourceGroupName, serviceName, apiId, createParameters, createIfMatch, Context.NONE); + return this; + } + + public ApiContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApis() + .createOrUpdate(resourceGroupName, serviceName, apiId, createParameters, createIfMatch, context); + return this; + } + + ApiContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new ApiContractInner(); + this.serviceManager = serviceManager; + this.apiId = name; + this.createIfMatch = null; + this.createParameters = new ApiCreateOrUpdateParameter(); + } + + public ApiContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new ApiUpdateContract(); + return this; + } + + public ApiContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApis() + .updateWithResponse( + resourceGroupName, serviceName, apiId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ApiContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApis() + .updateWithResponse(resourceGroupName, serviceName, apiId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + ApiContractImpl( + ApiContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + } + + public ApiContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApis() + .getWithResponse(resourceGroupName, serviceName, apiId, Context.NONE) + .getValue(); + return this; + } + + public ApiContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApis() + .getWithResponse(resourceGroupName, serviceName, apiId, context) + .getValue(); + return this; + } + + public ApiContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.createParameters.withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public ApiContractImpl withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings) { + if (isInCreateMode()) { + this.createParameters.withAuthenticationSettings(authenticationSettings); + return this; + } else { + this.updateParameters.withAuthenticationSettings(authenticationSettings); + return this; + } + } + + public ApiContractImpl withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + if (isInCreateMode()) { + this.createParameters.withSubscriptionKeyParameterNames(subscriptionKeyParameterNames); + return this; + } else { + this.updateParameters.withSubscriptionKeyParameterNames(subscriptionKeyParameterNames); + return this; + } + } + + public ApiContractImpl withApiType(ApiType apiType) { + if (isInCreateMode()) { + this.createParameters.withApiType(apiType); + return this; + } else { + this.updateParameters.withApiType(apiType); + return this; + } + } + + public ApiContractImpl withApiRevision(String apiRevision) { + if (isInCreateMode()) { + this.createParameters.withApiRevision(apiRevision); + return this; + } else { + this.updateParameters.withApiRevision(apiRevision); + return this; + } + } + + public ApiContractImpl withApiVersion(String apiVersion) { + if (isInCreateMode()) { + this.createParameters.withApiVersion(apiVersion); + return this; + } else { + this.updateParameters.withApiVersion(apiVersion); + return this; + } + } + + public ApiContractImpl withIsCurrent(Boolean isCurrent) { + if (isInCreateMode()) { + this.createParameters.withIsCurrent(isCurrent); + return this; + } else { + this.updateParameters.withIsCurrent(isCurrent); + return this; + } + } + + public ApiContractImpl withApiRevisionDescription(String apiRevisionDescription) { + if (isInCreateMode()) { + this.createParameters.withApiRevisionDescription(apiRevisionDescription); + return this; + } else { + this.updateParameters.withApiRevisionDescription(apiRevisionDescription); + return this; + } + } + + public ApiContractImpl withApiVersionDescription(String apiVersionDescription) { + if (isInCreateMode()) { + this.createParameters.withApiVersionDescription(apiVersionDescription); + return this; + } else { + this.updateParameters.withApiVersionDescription(apiVersionDescription); + return this; + } + } + + public ApiContractImpl withApiVersionSetId(String apiVersionSetId) { + if (isInCreateMode()) { + this.createParameters.withApiVersionSetId(apiVersionSetId); + return this; + } else { + this.updateParameters.withApiVersionSetId(apiVersionSetId); + return this; + } + } + + public ApiContractImpl withSubscriptionRequired(Boolean subscriptionRequired) { + if (isInCreateMode()) { + this.createParameters.withSubscriptionRequired(subscriptionRequired); + return this; + } else { + this.updateParameters.withSubscriptionRequired(subscriptionRequired); + return this; + } + } + + public ApiContractImpl withSourceApiId(String sourceApiId) { + this.createParameters.withSourceApiId(sourceApiId); + return this; + } + + public ApiContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.createParameters.withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public ApiContractImpl withServiceUrl(String serviceUrl) { + if (isInCreateMode()) { + this.createParameters.withServiceUrl(serviceUrl); + return this; + } else { + this.updateParameters.withServiceUrl(serviceUrl); + return this; + } + } + + public ApiContractImpl withPath(String path) { + if (isInCreateMode()) { + this.createParameters.withPath(path); + return this; + } else { + this.updateParameters.withPath(path); + return this; + } + } + + public ApiContractImpl withProtocols(List protocols) { + if (isInCreateMode()) { + this.createParameters.withProtocols(protocols); + return this; + } else { + this.updateParameters.withProtocols(protocols); + return this; + } + } + + public ApiContractImpl withApiVersionSet(ApiVersionSetContractDetails apiVersionSet) { + this.createParameters.withApiVersionSet(apiVersionSet); + return this; + } + + public ApiContractImpl withValue(String value) { + this.createParameters.withValue(value); + return this; + } + + public ApiContractImpl withFormat(ContentFormat format) { + this.createParameters.withFormat(format); + return this; + } + + public ApiContractImpl withWsdlSelector(ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector) { + this.createParameters.withWsdlSelector(wsdlSelector); + return this; + } + + public ApiContractImpl withSoapApiType(SoapApiType soapApiType) { + this.createParameters.withSoapApiType(soapApiType); + return this; + } + + public ApiContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsClientImpl.java new file mode 100644 index 0000000000000..c88800e4c7edc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsClientImpl.java @@ -0,0 +1,1577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiDiagnosticsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiDiagnosticsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiDiagnosticsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiDiagnosticsGetResponse; +import com.azure.resourcemanager.apimanagement.models.ApiDiagnosticsUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.DiagnosticCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiDiagnosticsClient. */ +public final class ApiDiagnosticsClientImpl implements ApiDiagnosticsClient { + private final ClientLogger logger = new ClientLogger(ApiDiagnosticsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiDiagnosticsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiDiagnosticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiDiagnosticsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiDiagnosticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiDiagnostics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiDiagnosticsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/diagnostics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("diagnosticId") String diagnosticId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("diagnosticId") String diagnosticId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("diagnosticId") String diagnosticId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DiagnosticContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("diagnosticId") String diagnosticId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DiagnosticContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("diagnosticId") String diagnosticId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId) + .flatMap((ApiDiagnosticsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, diagnosticId).block(); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, context).block(); + } + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId) + .flatMap( + (ApiDiagnosticsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticContractInner get( + String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + return getAsync(resourceGroupName, serviceName, apiId, diagnosticId).block(); + } + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, context).block(); + } + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch) + .flatMap( + (ApiDiagnosticsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch) + .flatMap( + (ApiDiagnosticsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch).block(); + } + + /** + * Creates a new Diagnostic for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, diagnosticId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch, parameters) + .flatMap( + (ApiDiagnosticsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters) { + return updateAsync(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, serviceName, apiId, diagnosticId, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String diagnosticId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String diagnosticId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String diagnosticId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String diagnosticId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch).block(); + } + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch, 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 paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsImpl.java new file mode 100644 index 0000000000000..21795eedbae22 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiDiagnosticsImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiDiagnosticsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiDiagnostics; +import com.azure.resourcemanager.apimanagement.models.DiagnosticContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiDiagnosticsImpl implements ApiDiagnostics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDiagnosticsImpl.class); + + private final ApiDiagnosticsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiDiagnosticsImpl( + ApiDiagnosticsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new DiagnosticContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new DiagnosticContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, diagnosticId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, context); + } + + public DiagnosticContract get(String resourceGroupName, String serviceName, String apiId, String diagnosticId) { + DiagnosticContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, diagnosticId); + if (inner != null) { + return new DiagnosticContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch, context); + } + + public DiagnosticContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String diagnosticId = Utils.getValueFromIdByName(id, "diagnostics"); + if (diagnosticId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diagnostics'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String diagnosticId = Utils.getValueFromIdByName(id, "diagnostics"); + if (diagnosticId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diagnostics'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String diagnosticId = Utils.getValueFromIdByName(id, "diagnostics"); + if (diagnosticId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diagnostics'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String diagnosticId = Utils.getValueFromIdByName(id, "diagnostics"); + if (diagnosticId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diagnostics'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, ifMatch, context); + } + + private ApiDiagnosticsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public DiagnosticContractImpl define(String name) { + return new DiagnosticContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportResultImpl.java new file mode 100644 index 0000000000000..7089af03ac06b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportResultImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiExportResultInner; +import com.azure.resourcemanager.apimanagement.models.ApiExportResult; +import com.azure.resourcemanager.apimanagement.models.ApiExportResultValue; +import com.azure.resourcemanager.apimanagement.models.ExportResultFormat; + +public final class ApiExportResultImpl implements ApiExportResult { + private ApiExportResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ApiExportResultImpl( + ApiExportResultInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public ExportResultFormat exportResultFormat() { + return this.innerModel().exportResultFormat(); + } + + public ApiExportResultValue value() { + return this.innerModel().value(); + } + + public ApiExportResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsClientImpl.java new file mode 100644 index 0000000000000..46bed12cc621d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsClientImpl.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiExportsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiExportResultInner; +import com.azure.resourcemanager.apimanagement.models.ExportApi; +import com.azure.resourcemanager.apimanagement.models.ExportFormat; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiExportsClient. */ +public final class ApiExportsClientImpl implements ApiExportsClient { + private final ClientLogger logger = new ClientLogger(ApiExportsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiExportsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiExportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiExportsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiExportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiExports to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiExportsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("format") ExportFormat format, + @QueryParam("export") ExportApi export, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, ExportFormat format, ExportApi export) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (format == null) { + return Mono.error(new IllegalArgumentException("Parameter format is required and cannot be null.")); + } + if (export == null) { + return Mono.error(new IllegalArgumentException("Parameter export is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + format, + export, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + ExportFormat format, + ExportApi export, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (format == null) { + return Mono.error(new IllegalArgumentException("Parameter format is required and cannot be null.")); + } + if (export == null) { + return Mono.error(new IllegalArgumentException("Parameter export is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + format, + export, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, ExportFormat format, ExportApi export) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, format, export) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiExportResultInner get( + String resourceGroupName, String serviceName, String apiId, ExportFormat format, ExportApi export) { + return getAsync(resourceGroupName, serviceName, apiId, format, export).block(); + } + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + ExportFormat format, + ExportApi export, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, format, export, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsImpl.java new file mode 100644 index 0000000000000..f77fa63f2a193 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiExportsImpl.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.apimanagement.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.apimanagement.fluent.ApiExportsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiExportResultInner; +import com.azure.resourcemanager.apimanagement.models.ApiExportResult; +import com.azure.resourcemanager.apimanagement.models.ApiExports; +import com.azure.resourcemanager.apimanagement.models.ExportApi; +import com.azure.resourcemanager.apimanagement.models.ExportFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiExportsImpl implements ApiExports { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiExportsImpl.class); + + private final ApiExportsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiExportsImpl( + ApiExportsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ApiExportResult get( + String resourceGroupName, String serviceName, String apiId, ExportFormat format, ExportApi export) { + ApiExportResultInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, format, export); + if (inner != null) { + return new ApiExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + ExportFormat format, + ExportApi export, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, format, export, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiExportResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ApiExportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsClientImpl.java new file mode 100644 index 0000000000000..56dcd82308e83 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsClientImpl.java @@ -0,0 +1,1460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiIssueAttachmentsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiIssueAttachmentsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssueAttachmentsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssueAttachmentsGetResponse; +import com.azure.resourcemanager.apimanagement.models.IssueAttachmentCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiIssueAttachmentsClient. */ +public final class ApiIssueAttachmentsClientImpl implements ApiIssueAttachmentsClient { + private final ClientLogger logger = new ClientLogger(ApiIssueAttachmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiIssueAttachmentsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiIssueAttachmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiIssueAttachmentsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiIssueAttachmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiIssueAttachments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiIssueAttachmentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("attachmentId") String attachmentId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("attachmentId") String attachmentId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("attachmentId") String attachmentId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IssueAttachmentContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("attachmentId") String attachmentId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId, String issueId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, apiId, issueId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip)); + } + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId) + .flatMap((ApiIssueAttachmentsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId).block(); + } + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId, context) + .block(); + } + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId) + .flatMap( + (ApiIssueAttachmentsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueAttachmentContractInner get( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + return getAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId).block(); + } + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId, context).block(); + } + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, attachmentId, parameters, ifMatch) + .flatMap( + (ApiIssueAttachmentsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, attachmentId, parameters, ifMatch) + .flatMap( + (ApiIssueAttachmentsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueAttachmentContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId, parameters, ifMatch) + .block(); + } + + /** + * Creates a new Attachment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Attachment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + IssueAttachmentContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, attachmentId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (attachmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter attachmentId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId, ifMatch).block(); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, attachmentId, ifMatch, 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 paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsImpl.java new file mode 100644 index 0000000000000..21f1be7cd14d2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueAttachmentsImpl.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiIssueAttachmentsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiIssueAttachments; +import com.azure.resourcemanager.apimanagement.models.IssueAttachmentContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiIssueAttachmentsImpl implements ApiIssueAttachments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueAttachmentsImpl.class); + + private final ApiIssueAttachmentsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiIssueAttachmentsImpl( + ApiIssueAttachmentsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId, issueId); + return Utils.mapPage(inner, inner1 -> new IssueAttachmentContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, apiId, issueId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new IssueAttachmentContractImpl(inner1, this.manager())); + } + + public void getEntityTag( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, issueId, attachmentId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, context); + } + + public IssueAttachmentContract get( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId) { + IssueAttachmentContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, apiId, issueId, attachmentId); + if (inner != null) { + return new IssueAttachmentContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IssueAttachmentContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, issueId, attachmentId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, ifMatch, context); + } + + public IssueAttachmentContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String attachmentId = Utils.getValueFromIdByName(id, "attachments"); + if (attachmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'attachments'.", id))); + } + return this + .getWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String attachmentId = Utils.getValueFromIdByName(id, "attachments"); + if (attachmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'attachments'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String attachmentId = Utils.getValueFromIdByName(id, "attachments"); + if (attachmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'attachments'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse( + resourceGroupName, serviceName, apiId, issueId, attachmentId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String attachmentId = Utils.getValueFromIdByName(id, "attachments"); + if (attachmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'attachments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, ifMatch, context); + } + + private ApiIssueAttachmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public IssueAttachmentContractImpl define(String name) { + return new IssueAttachmentContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsClientImpl.java new file mode 100644 index 0000000000000..ba66f6f776802 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsClientImpl.java @@ -0,0 +1,1425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiIssueCommentsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiIssueCommentsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssueCommentsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssueCommentsGetResponse; +import com.azure.resourcemanager.apimanagement.models.IssueCommentCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiIssueCommentsClient. */ +public final class ApiIssueCommentsClientImpl implements ApiIssueCommentsClient { + private final ClientLogger logger = new ClientLogger(ApiIssueCommentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiIssueCommentsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiIssueCommentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiIssueCommentsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiIssueCommentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiIssueComments to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiIssueCommentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("commentId") String commentId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("commentId") String commentId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("commentId") String commentId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IssueCommentContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @PathParam("commentId") String commentId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId, String issueId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, apiId, issueId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip)); + } + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, issueId, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, commentId) + .flatMap((ApiIssueCommentsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, issueId, commentId).block(); + } + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, commentId, context) + .block(); + } + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, commentId) + .flatMap( + (ApiIssueCommentsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueCommentContractInner get( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + return getAsync(resourceGroupName, serviceName, apiId, issueId, commentId).block(); + } + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, commentId, context).block(); + } + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, commentId, parameters, ifMatch) + .flatMap( + (ApiIssueCommentsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, commentId, parameters, ifMatch) + .flatMap( + (ApiIssueCommentsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueCommentContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, issueId, commentId, parameters, ifMatch) + .block(); + } + + /** + * Creates a new Comment for the Issue in an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Comment Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + IssueCommentContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, commentId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String issueId, String commentId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String issueId, + String commentId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (commentId == null) { + return Mono.error(new IllegalArgumentException("Parameter commentId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String issueId, String commentId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, commentId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String issueId, String commentId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, issueId, commentId, ifMatch).block(); + } + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, commentId, ifMatch, 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 paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsImpl.java new file mode 100644 index 0000000000000..231577776d058 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssueCommentsImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiIssueCommentsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiIssueComments; +import com.azure.resourcemanager.apimanagement.models.IssueCommentContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiIssueCommentsImpl implements ApiIssueComments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueCommentsImpl.class); + + private final ApiIssueCommentsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiIssueCommentsImpl( + ApiIssueCommentsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId, issueId); + return Utils.mapPage(inner, inner1 -> new IssueCommentContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, apiId, issueId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new IssueCommentContractImpl(inner1, this.manager())); + } + + public void getEntityTag( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, issueId, commentId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, context); + } + + public IssueCommentContract get( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId) { + IssueCommentContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, apiId, issueId, commentId); + if (inner != null) { + return new IssueCommentContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IssueCommentContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, issueId, commentId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, ifMatch, context); + } + + public IssueCommentContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String commentId = Utils.getValueFromIdByName(id, "comments"); + if (commentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String commentId = Utils.getValueFromIdByName(id, "comments"); + if (commentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String commentId = Utils.getValueFromIdByName(id, "comments"); + if (commentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String commentId = Utils.getValueFromIdByName(id, "comments"); + if (commentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, ifMatch, context); + } + + private ApiIssueCommentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public IssueCommentContractImpl define(String name) { + return new IssueCommentContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesClientImpl.java new file mode 100644 index 0000000000000..f3669d577ac98 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesClientImpl.java @@ -0,0 +1,1638 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiIssuesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiIssuesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssuesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssuesGetResponse; +import com.azure.resourcemanager.apimanagement.models.ApiIssuesUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.IssueCollection; +import com.azure.resourcemanager.apimanagement.models.IssueUpdateContract; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiIssuesClient. */ +public final class ApiIssuesClientImpl implements ApiIssuesClient { + private final ClientLogger logger = new ClientLogger(ApiIssuesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiIssuesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiIssuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiIssuesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiIssuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiIssues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiIssuesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("expandCommentsAttachments") Boolean expandCommentsAttachments, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @QueryParam("expandCommentsAttachments") Boolean expandCommentsAttachments, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IssueContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IssueUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/issues/{issueId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("issueId") String issueId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + expandCommentsAttachments, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + expandCommentsAttachments, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, apiId, filter, expandCommentsAttachments, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Boolean expandCommentsAttachments = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, apiId, filter, expandCommentsAttachments, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, apiId, filter, expandCommentsAttachments, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Boolean expandCommentsAttachments = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, filter, expandCommentsAttachments, top, skip)); + } + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync( + resourceGroupName, serviceName, apiId, filter, expandCommentsAttachments, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String apiId, String issueId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, issueId) + .flatMap((ApiIssuesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, issueId).block(); + } + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, context).block(); + } + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param expandCommentsAttachments Expand the comment attachments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, Boolean expandCommentsAttachments) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + expandCommentsAttachments, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param expandCommentsAttachments Expand the comment attachments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + Boolean expandCommentsAttachments, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + expandCommentsAttachments, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param expandCommentsAttachments Expand the comment attachments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, Boolean expandCommentsAttachments) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, expandCommentsAttachments) + .flatMap( + (ApiIssuesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String issueId) { + final Boolean expandCommentsAttachments = null; + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, expandCommentsAttachments) + .flatMap( + (ApiIssuesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueContractInner get(String resourceGroupName, String serviceName, String apiId, String issueId) { + final Boolean expandCommentsAttachments = null; + return getAsync(resourceGroupName, serviceName, apiId, issueId, expandCommentsAttachments).block(); + } + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param expandCommentsAttachments Expand the comment attachments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + Boolean expandCommentsAttachments, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, expandCommentsAttachments, context) + .block(); + } + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + IssueContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + IssueContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + IssueContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch) + .flatMap( + (ApiIssuesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String apiId, String issueId, IssueContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch) + .flatMap( + (ApiIssuesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueContractInner createOrUpdate( + String resourceGroupName, String serviceName, String apiId, String issueId, IssueContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch).block(); + } + + /** + * Creates a new Issue for an API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + IssueContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, issueId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, ifMatch, parameters) + .flatMap( + (ApiIssuesUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, apiId, issueId, ifMatch, parameters).block(); + } + + /** + * Updates an existing issue for an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return issue Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String ifMatch, + IssueUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String issueId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String issueId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + issueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String issueId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String issueId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, issueId, ifMatch).block(); + } + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, issueId, ifMatch, 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 paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesImpl.java new file mode 100644 index 0000000000000..ae996edf25560 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiIssuesImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiIssuesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiIssues; +import com.azure.resourcemanager.apimanagement.models.IssueContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiIssuesImpl implements ApiIssues { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssuesImpl.class); + + private final ApiIssuesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiIssuesImpl( + ApiIssuesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new IssueContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService( + resourceGroupName, serviceName, apiId, filter, expandCommentsAttachments, top, skip, context); + return Utils.mapPage(inner, inner1 -> new IssueContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, issueId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, apiId, issueId, context); + } + + public IssueContract get(String resourceGroupName, String serviceName, String apiId, String issueId) { + IssueContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, issueId); + if (inner != null) { + return new IssueContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + Boolean expandCommentsAttachments, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, serviceName, apiId, issueId, expandCommentsAttachments, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IssueContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiId, String issueId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, issueId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String ifMatch, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, ifMatch, context); + } + + public IssueContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + Boolean localExpandCommentsAttachments = null; + return this + .getWithResponse( + resourceGroupName, serviceName, apiId, issueId, localExpandCommentsAttachments, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Boolean expandCommentsAttachments, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, issueId, expandCommentsAttachments, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String issueId = Utils.getValueFromIdByName(id, "issues"); + if (issueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'issues'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, issueId, ifMatch, context); + } + + private ApiIssuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public IssueContractImpl define(String name) { + return new IssueContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientBuilder.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientBuilder.java new file mode 100644 index 0000000000000..305c4f5799ee7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientBuilder.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.apimanagement.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 ApiManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ApiManagementClientImpl.class}) +public final class ApiManagementClientBuilder { + /* + * Subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the ApiManagementClientBuilder. + */ + public ApiManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ApiManagementClientBuilder. + */ + public ApiManagementClientBuilder 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 ApiManagementClientBuilder. + */ + public ApiManagementClientBuilder 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 ApiManagementClientBuilder. + */ + public ApiManagementClientBuilder 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 ApiManagementClientBuilder. + */ + public ApiManagementClientBuilder 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 ApiManagementClientBuilder. + */ + public ApiManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ApiManagementClientImpl with the provided parameters. + * + * @return an instance of ApiManagementClientImpl. + */ + public ApiManagementClientImpl 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(); + } + ApiManagementClientImpl client = + new ApiManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientImpl.java new file mode 100644 index 0000000000000..7d5c2e34a144d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementClientImpl.java @@ -0,0 +1,1292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiDiagnosticsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiExportsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiIssueAttachmentsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiIssueCommentsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiIssuesClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiManagementClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiManagementOperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiManagementServiceSkusClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiManagementServicesClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiManagementSkusClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiOperationPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiOperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiProductsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiReleasesClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiRevisionsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiSchemasClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiTagDescriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApiVersionSetsClient; +import com.azure.resourcemanager.apimanagement.fluent.ApisClient; +import com.azure.resourcemanager.apimanagement.fluent.AuthorizationServersClient; +import com.azure.resourcemanager.apimanagement.fluent.BackendsClient; +import com.azure.resourcemanager.apimanagement.fluent.CachesClient; +import com.azure.resourcemanager.apimanagement.fluent.CertificatesClient; +import com.azure.resourcemanager.apimanagement.fluent.ContentItemsClient; +import com.azure.resourcemanager.apimanagement.fluent.ContentTypesClient; +import com.azure.resourcemanager.apimanagement.fluent.DelegationSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.DeletedServicesClient; +import com.azure.resourcemanager.apimanagement.fluent.DiagnosticsClient; +import com.azure.resourcemanager.apimanagement.fluent.EmailTemplatesClient; +import com.azure.resourcemanager.apimanagement.fluent.GatewayApisClient; +import com.azure.resourcemanager.apimanagement.fluent.GatewayCertificateAuthoritiesClient; +import com.azure.resourcemanager.apimanagement.fluent.GatewayHostnameConfigurationsClient; +import com.azure.resourcemanager.apimanagement.fluent.GatewaysClient; +import com.azure.resourcemanager.apimanagement.fluent.GroupUsersClient; +import com.azure.resourcemanager.apimanagement.fluent.GroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.IdentityProvidersClient; +import com.azure.resourcemanager.apimanagement.fluent.IssuesClient; +import com.azure.resourcemanager.apimanagement.fluent.LoggersClient; +import com.azure.resourcemanager.apimanagement.fluent.NamedValuesClient; +import com.azure.resourcemanager.apimanagement.fluent.NetworkStatusClient; +import com.azure.resourcemanager.apimanagement.fluent.NotificationRecipientEmailsClient; +import com.azure.resourcemanager.apimanagement.fluent.NotificationRecipientUsersClient; +import com.azure.resourcemanager.apimanagement.fluent.NotificationsClient; +import com.azure.resourcemanager.apimanagement.fluent.OpenIdConnectProvidersClient; +import com.azure.resourcemanager.apimanagement.fluent.OperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.PoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.PolicyDescriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.PortalRevisionsClient; +import com.azure.resourcemanager.apimanagement.fluent.PortalSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.ProductApisClient; +import com.azure.resourcemanager.apimanagement.fluent.ProductGroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.ProductPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.ProductSubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.ProductsClient; +import com.azure.resourcemanager.apimanagement.fluent.QuotaByCounterKeysClient; +import com.azure.resourcemanager.apimanagement.fluent.QuotaByPeriodKeysClient; +import com.azure.resourcemanager.apimanagement.fluent.RegionsClient; +import com.azure.resourcemanager.apimanagement.fluent.ReportsClient; +import com.azure.resourcemanager.apimanagement.fluent.SignInSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.SignUpSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.SubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.TagResourcesClient; +import com.azure.resourcemanager.apimanagement.fluent.TagsClient; +import com.azure.resourcemanager.apimanagement.fluent.TenantAccessClient; +import com.azure.resourcemanager.apimanagement.fluent.TenantAccessGitsClient; +import com.azure.resourcemanager.apimanagement.fluent.TenantConfigurationsClient; +import com.azure.resourcemanager.apimanagement.fluent.TenantSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.UserConfirmationPasswordsClient; +import com.azure.resourcemanager.apimanagement.fluent.UserGroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.UserIdentitiesClient; +import com.azure.resourcemanager.apimanagement.fluent.UserSubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.UsersClient; +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 ApiManagementClientImpl type. */ +@ServiceClient(builder = ApiManagementClientBuilder.class) +public final class ApiManagementClientImpl implements ApiManagementClient { + private final ClientLogger logger = new ClientLogger(ApiManagementClientImpl.class); + + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify 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; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ApisClient object to access its operations. */ + private final ApisClient apis; + + /** + * Gets the ApisClient object to access its operations. + * + * @return the ApisClient object. + */ + public ApisClient getApis() { + return this.apis; + } + + /** The ApiRevisionsClient object to access its operations. */ + private final ApiRevisionsClient apiRevisions; + + /** + * Gets the ApiRevisionsClient object to access its operations. + * + * @return the ApiRevisionsClient object. + */ + public ApiRevisionsClient getApiRevisions() { + return this.apiRevisions; + } + + /** The ApiReleasesClient object to access its operations. */ + private final ApiReleasesClient apiReleases; + + /** + * Gets the ApiReleasesClient object to access its operations. + * + * @return the ApiReleasesClient object. + */ + public ApiReleasesClient getApiReleases() { + return this.apiReleases; + } + + /** The ApiOperationsClient object to access its operations. */ + private final ApiOperationsClient apiOperations; + + /** + * Gets the ApiOperationsClient object to access its operations. + * + * @return the ApiOperationsClient object. + */ + public ApiOperationsClient getApiOperations() { + return this.apiOperations; + } + + /** The ApiOperationPoliciesClient object to access its operations. */ + private final ApiOperationPoliciesClient apiOperationPolicies; + + /** + * Gets the ApiOperationPoliciesClient object to access its operations. + * + * @return the ApiOperationPoliciesClient object. + */ + public ApiOperationPoliciesClient getApiOperationPolicies() { + return this.apiOperationPolicies; + } + + /** The TagsClient object to access its operations. */ + private final TagsClient tags; + + /** + * Gets the TagsClient object to access its operations. + * + * @return the TagsClient object. + */ + public TagsClient getTags() { + return this.tags; + } + + /** The ApiProductsClient object to access its operations. */ + private final ApiProductsClient apiProducts; + + /** + * Gets the ApiProductsClient object to access its operations. + * + * @return the ApiProductsClient object. + */ + public ApiProductsClient getApiProducts() { + return this.apiProducts; + } + + /** The ApiPoliciesClient object to access its operations. */ + private final ApiPoliciesClient apiPolicies; + + /** + * Gets the ApiPoliciesClient object to access its operations. + * + * @return the ApiPoliciesClient object. + */ + public ApiPoliciesClient getApiPolicies() { + return this.apiPolicies; + } + + /** The ApiSchemasClient object to access its operations. */ + private final ApiSchemasClient apiSchemas; + + /** + * Gets the ApiSchemasClient object to access its operations. + * + * @return the ApiSchemasClient object. + */ + public ApiSchemasClient getApiSchemas() { + return this.apiSchemas; + } + + /** The ApiDiagnosticsClient object to access its operations. */ + private final ApiDiagnosticsClient apiDiagnostics; + + /** + * Gets the ApiDiagnosticsClient object to access its operations. + * + * @return the ApiDiagnosticsClient object. + */ + public ApiDiagnosticsClient getApiDiagnostics() { + return this.apiDiagnostics; + } + + /** The ApiIssuesClient object to access its operations. */ + private final ApiIssuesClient apiIssues; + + /** + * Gets the ApiIssuesClient object to access its operations. + * + * @return the ApiIssuesClient object. + */ + public ApiIssuesClient getApiIssues() { + return this.apiIssues; + } + + /** The ApiIssueCommentsClient object to access its operations. */ + private final ApiIssueCommentsClient apiIssueComments; + + /** + * Gets the ApiIssueCommentsClient object to access its operations. + * + * @return the ApiIssueCommentsClient object. + */ + public ApiIssueCommentsClient getApiIssueComments() { + return this.apiIssueComments; + } + + /** The ApiIssueAttachmentsClient object to access its operations. */ + private final ApiIssueAttachmentsClient apiIssueAttachments; + + /** + * Gets the ApiIssueAttachmentsClient object to access its operations. + * + * @return the ApiIssueAttachmentsClient object. + */ + public ApiIssueAttachmentsClient getApiIssueAttachments() { + return this.apiIssueAttachments; + } + + /** The ApiTagDescriptionsClient object to access its operations. */ + private final ApiTagDescriptionsClient apiTagDescriptions; + + /** + * Gets the ApiTagDescriptionsClient object to access its operations. + * + * @return the ApiTagDescriptionsClient object. + */ + public ApiTagDescriptionsClient getApiTagDescriptions() { + return this.apiTagDescriptions; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The ApiExportsClient object to access its operations. */ + private final ApiExportsClient apiExports; + + /** + * Gets the ApiExportsClient object to access its operations. + * + * @return the ApiExportsClient object. + */ + public ApiExportsClient getApiExports() { + return this.apiExports; + } + + /** The ApiVersionSetsClient object to access its operations. */ + private final ApiVersionSetsClient apiVersionSets; + + /** + * Gets the ApiVersionSetsClient object to access its operations. + * + * @return the ApiVersionSetsClient object. + */ + public ApiVersionSetsClient getApiVersionSets() { + return this.apiVersionSets; + } + + /** The AuthorizationServersClient object to access its operations. */ + private final AuthorizationServersClient authorizationServers; + + /** + * Gets the AuthorizationServersClient object to access its operations. + * + * @return the AuthorizationServersClient object. + */ + public AuthorizationServersClient getAuthorizationServers() { + return this.authorizationServers; + } + + /** The BackendsClient object to access its operations. */ + private final BackendsClient backends; + + /** + * Gets the BackendsClient object to access its operations. + * + * @return the BackendsClient object. + */ + public BackendsClient getBackends() { + return this.backends; + } + + /** The CachesClient object to access its operations. */ + private final CachesClient caches; + + /** + * Gets the CachesClient object to access its operations. + * + * @return the CachesClient object. + */ + public CachesClient getCaches() { + return this.caches; + } + + /** The CertificatesClient object to access its operations. */ + private final CertificatesClient certificates; + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + public CertificatesClient getCertificates() { + return this.certificates; + } + + /** The ContentTypesClient object to access its operations. */ + private final ContentTypesClient contentTypes; + + /** + * Gets the ContentTypesClient object to access its operations. + * + * @return the ContentTypesClient object. + */ + public ContentTypesClient getContentTypes() { + return this.contentTypes; + } + + /** The ContentItemsClient object to access its operations. */ + private final ContentItemsClient contentItems; + + /** + * Gets the ContentItemsClient object to access its operations. + * + * @return the ContentItemsClient object. + */ + public ContentItemsClient getContentItems() { + return this.contentItems; + } + + /** The DeletedServicesClient object to access its operations. */ + private final DeletedServicesClient deletedServices; + + /** + * Gets the DeletedServicesClient object to access its operations. + * + * @return the DeletedServicesClient object. + */ + public DeletedServicesClient getDeletedServices() { + return this.deletedServices; + } + + /** The ApiManagementOperationsClient object to access its operations. */ + private final ApiManagementOperationsClient apiManagementOperations; + + /** + * Gets the ApiManagementOperationsClient object to access its operations. + * + * @return the ApiManagementOperationsClient object. + */ + public ApiManagementOperationsClient getApiManagementOperations() { + return this.apiManagementOperations; + } + + /** The ApiManagementServiceSkusClient object to access its operations. */ + private final ApiManagementServiceSkusClient apiManagementServiceSkus; + + /** + * Gets the ApiManagementServiceSkusClient object to access its operations. + * + * @return the ApiManagementServiceSkusClient object. + */ + public ApiManagementServiceSkusClient getApiManagementServiceSkus() { + return this.apiManagementServiceSkus; + } + + /** The ApiManagementServicesClient object to access its operations. */ + private final ApiManagementServicesClient apiManagementServices; + + /** + * Gets the ApiManagementServicesClient object to access its operations. + * + * @return the ApiManagementServicesClient object. + */ + public ApiManagementServicesClient getApiManagementServices() { + return this.apiManagementServices; + } + + /** The DiagnosticsClient object to access its operations. */ + private final DiagnosticsClient diagnostics; + + /** + * Gets the DiagnosticsClient object to access its operations. + * + * @return the DiagnosticsClient object. + */ + public DiagnosticsClient getDiagnostics() { + return this.diagnostics; + } + + /** The EmailTemplatesClient object to access its operations. */ + private final EmailTemplatesClient emailTemplates; + + /** + * Gets the EmailTemplatesClient object to access its operations. + * + * @return the EmailTemplatesClient object. + */ + public EmailTemplatesClient getEmailTemplates() { + return this.emailTemplates; + } + + /** The GatewaysClient object to access its operations. */ + private final GatewaysClient gateways; + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + public GatewaysClient getGateways() { + return this.gateways; + } + + /** The GatewayHostnameConfigurationsClient object to access its operations. */ + private final GatewayHostnameConfigurationsClient gatewayHostnameConfigurations; + + /** + * Gets the GatewayHostnameConfigurationsClient object to access its operations. + * + * @return the GatewayHostnameConfigurationsClient object. + */ + public GatewayHostnameConfigurationsClient getGatewayHostnameConfigurations() { + return this.gatewayHostnameConfigurations; + } + + /** The GatewayApisClient object to access its operations. */ + private final GatewayApisClient gatewayApis; + + /** + * Gets the GatewayApisClient object to access its operations. + * + * @return the GatewayApisClient object. + */ + public GatewayApisClient getGatewayApis() { + return this.gatewayApis; + } + + /** The GatewayCertificateAuthoritiesClient object to access its operations. */ + private final GatewayCertificateAuthoritiesClient gatewayCertificateAuthorities; + + /** + * Gets the GatewayCertificateAuthoritiesClient object to access its operations. + * + * @return the GatewayCertificateAuthoritiesClient object. + */ + public GatewayCertificateAuthoritiesClient getGatewayCertificateAuthorities() { + return this.gatewayCertificateAuthorities; + } + + /** The GroupsClient object to access its operations. */ + private final GroupsClient groups; + + /** + * Gets the GroupsClient object to access its operations. + * + * @return the GroupsClient object. + */ + public GroupsClient getGroups() { + return this.groups; + } + + /** The GroupUsersClient object to access its operations. */ + private final GroupUsersClient groupUsers; + + /** + * Gets the GroupUsersClient object to access its operations. + * + * @return the GroupUsersClient object. + */ + public GroupUsersClient getGroupUsers() { + return this.groupUsers; + } + + /** The IdentityProvidersClient object to access its operations. */ + private final IdentityProvidersClient identityProviders; + + /** + * Gets the IdentityProvidersClient object to access its operations. + * + * @return the IdentityProvidersClient object. + */ + public IdentityProvidersClient getIdentityProviders() { + return this.identityProviders; + } + + /** The IssuesClient object to access its operations. */ + private final IssuesClient issues; + + /** + * Gets the IssuesClient object to access its operations. + * + * @return the IssuesClient object. + */ + public IssuesClient getIssues() { + return this.issues; + } + + /** The LoggersClient object to access its operations. */ + private final LoggersClient loggers; + + /** + * Gets the LoggersClient object to access its operations. + * + * @return the LoggersClient object. + */ + public LoggersClient getLoggers() { + return this.loggers; + } + + /** The NamedValuesClient object to access its operations. */ + private final NamedValuesClient namedValues; + + /** + * Gets the NamedValuesClient object to access its operations. + * + * @return the NamedValuesClient object. + */ + public NamedValuesClient getNamedValues() { + return this.namedValues; + } + + /** The NetworkStatusClient object to access its operations. */ + private final NetworkStatusClient networkStatus; + + /** + * Gets the NetworkStatusClient object to access its operations. + * + * @return the NetworkStatusClient object. + */ + public NetworkStatusClient getNetworkStatus() { + return this.networkStatus; + } + + /** The NotificationsClient object to access its operations. */ + private final NotificationsClient notifications; + + /** + * Gets the NotificationsClient object to access its operations. + * + * @return the NotificationsClient object. + */ + public NotificationsClient getNotifications() { + return this.notifications; + } + + /** The NotificationRecipientUsersClient object to access its operations. */ + private final NotificationRecipientUsersClient notificationRecipientUsers; + + /** + * Gets the NotificationRecipientUsersClient object to access its operations. + * + * @return the NotificationRecipientUsersClient object. + */ + public NotificationRecipientUsersClient getNotificationRecipientUsers() { + return this.notificationRecipientUsers; + } + + /** The NotificationRecipientEmailsClient object to access its operations. */ + private final NotificationRecipientEmailsClient notificationRecipientEmails; + + /** + * Gets the NotificationRecipientEmailsClient object to access its operations. + * + * @return the NotificationRecipientEmailsClient object. + */ + public NotificationRecipientEmailsClient getNotificationRecipientEmails() { + return this.notificationRecipientEmails; + } + + /** The OpenIdConnectProvidersClient object to access its operations. */ + private final OpenIdConnectProvidersClient openIdConnectProviders; + + /** + * Gets the OpenIdConnectProvidersClient object to access its operations. + * + * @return the OpenIdConnectProvidersClient object. + */ + public OpenIdConnectProvidersClient getOpenIdConnectProviders() { + return this.openIdConnectProviders; + } + + /** 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 PolicyDescriptionsClient object to access its operations. */ + private final PolicyDescriptionsClient policyDescriptions; + + /** + * Gets the PolicyDescriptionsClient object to access its operations. + * + * @return the PolicyDescriptionsClient object. + */ + public PolicyDescriptionsClient getPolicyDescriptions() { + return this.policyDescriptions; + } + + /** The PortalRevisionsClient object to access its operations. */ + private final PortalRevisionsClient portalRevisions; + + /** + * Gets the PortalRevisionsClient object to access its operations. + * + * @return the PortalRevisionsClient object. + */ + public PortalRevisionsClient getPortalRevisions() { + return this.portalRevisions; + } + + /** The PortalSettingsClient object to access its operations. */ + private final PortalSettingsClient portalSettings; + + /** + * Gets the PortalSettingsClient object to access its operations. + * + * @return the PortalSettingsClient object. + */ + public PortalSettingsClient getPortalSettings() { + return this.portalSettings; + } + + /** The SignInSettingsClient object to access its operations. */ + private final SignInSettingsClient signInSettings; + + /** + * Gets the SignInSettingsClient object to access its operations. + * + * @return the SignInSettingsClient object. + */ + public SignInSettingsClient getSignInSettings() { + return this.signInSettings; + } + + /** The SignUpSettingsClient object to access its operations. */ + private final SignUpSettingsClient signUpSettings; + + /** + * Gets the SignUpSettingsClient object to access its operations. + * + * @return the SignUpSettingsClient object. + */ + public SignUpSettingsClient getSignUpSettings() { + return this.signUpSettings; + } + + /** The DelegationSettingsClient object to access its operations. */ + private final DelegationSettingsClient delegationSettings; + + /** + * Gets the DelegationSettingsClient object to access its operations. + * + * @return the DelegationSettingsClient object. + */ + public DelegationSettingsClient getDelegationSettings() { + return this.delegationSettings; + } + + /** The ProductsClient object to access its operations. */ + private final ProductsClient products; + + /** + * Gets the ProductsClient object to access its operations. + * + * @return the ProductsClient object. + */ + public ProductsClient getProducts() { + return this.products; + } + + /** The ProductApisClient object to access its operations. */ + private final ProductApisClient productApis; + + /** + * Gets the ProductApisClient object to access its operations. + * + * @return the ProductApisClient object. + */ + public ProductApisClient getProductApis() { + return this.productApis; + } + + /** The ProductGroupsClient object to access its operations. */ + private final ProductGroupsClient productGroups; + + /** + * Gets the ProductGroupsClient object to access its operations. + * + * @return the ProductGroupsClient object. + */ + public ProductGroupsClient getProductGroups() { + return this.productGroups; + } + + /** The ProductSubscriptionsClient object to access its operations. */ + private final ProductSubscriptionsClient productSubscriptions; + + /** + * Gets the ProductSubscriptionsClient object to access its operations. + * + * @return the ProductSubscriptionsClient object. + */ + public ProductSubscriptionsClient getProductSubscriptions() { + return this.productSubscriptions; + } + + /** The ProductPoliciesClient object to access its operations. */ + private final ProductPoliciesClient productPolicies; + + /** + * Gets the ProductPoliciesClient object to access its operations. + * + * @return the ProductPoliciesClient object. + */ + public ProductPoliciesClient getProductPolicies() { + return this.productPolicies; + } + + /** The QuotaByCounterKeysClient object to access its operations. */ + private final QuotaByCounterKeysClient quotaByCounterKeys; + + /** + * Gets the QuotaByCounterKeysClient object to access its operations. + * + * @return the QuotaByCounterKeysClient object. + */ + public QuotaByCounterKeysClient getQuotaByCounterKeys() { + return this.quotaByCounterKeys; + } + + /** The QuotaByPeriodKeysClient object to access its operations. */ + private final QuotaByPeriodKeysClient quotaByPeriodKeys; + + /** + * Gets the QuotaByPeriodKeysClient object to access its operations. + * + * @return the QuotaByPeriodKeysClient object. + */ + public QuotaByPeriodKeysClient getQuotaByPeriodKeys() { + return this.quotaByPeriodKeys; + } + + /** The RegionsClient object to access its operations. */ + private final RegionsClient regions; + + /** + * Gets the RegionsClient object to access its operations. + * + * @return the RegionsClient object. + */ + public RegionsClient getRegions() { + return this.regions; + } + + /** 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 TenantSettingsClient object to access its operations. */ + private final TenantSettingsClient tenantSettings; + + /** + * Gets the TenantSettingsClient object to access its operations. + * + * @return the TenantSettingsClient object. + */ + public TenantSettingsClient getTenantSettings() { + return this.tenantSettings; + } + + /** The ApiManagementSkusClient object to access its operations. */ + private final ApiManagementSkusClient apiManagementSkus; + + /** + * Gets the ApiManagementSkusClient object to access its operations. + * + * @return the ApiManagementSkusClient object. + */ + public ApiManagementSkusClient getApiManagementSkus() { + return this.apiManagementSkus; + } + + /** The SubscriptionsClient object to access its operations. */ + private final SubscriptionsClient subscriptions; + + /** + * Gets the SubscriptionsClient object to access its operations. + * + * @return the SubscriptionsClient object. + */ + public SubscriptionsClient getSubscriptions() { + return this.subscriptions; + } + + /** The TagResourcesClient object to access its operations. */ + private final TagResourcesClient tagResources; + + /** + * Gets the TagResourcesClient object to access its operations. + * + * @return the TagResourcesClient object. + */ + public TagResourcesClient getTagResources() { + return this.tagResources; + } + + /** The TenantAccessClient object to access its operations. */ + private final TenantAccessClient tenantAccess; + + /** + * Gets the TenantAccessClient object to access its operations. + * + * @return the TenantAccessClient object. + */ + public TenantAccessClient getTenantAccess() { + return this.tenantAccess; + } + + /** The TenantAccessGitsClient object to access its operations. */ + private final TenantAccessGitsClient tenantAccessGits; + + /** + * Gets the TenantAccessGitsClient object to access its operations. + * + * @return the TenantAccessGitsClient object. + */ + public TenantAccessGitsClient getTenantAccessGits() { + return this.tenantAccessGits; + } + + /** The TenantConfigurationsClient object to access its operations. */ + private final TenantConfigurationsClient tenantConfigurations; + + /** + * Gets the TenantConfigurationsClient object to access its operations. + * + * @return the TenantConfigurationsClient object. + */ + public TenantConfigurationsClient getTenantConfigurations() { + return this.tenantConfigurations; + } + + /** The UsersClient object to access its operations. */ + private final UsersClient users; + + /** + * Gets the UsersClient object to access its operations. + * + * @return the UsersClient object. + */ + public UsersClient getUsers() { + return this.users; + } + + /** The UserGroupsClient object to access its operations. */ + private final UserGroupsClient userGroups; + + /** + * Gets the UserGroupsClient object to access its operations. + * + * @return the UserGroupsClient object. + */ + public UserGroupsClient getUserGroups() { + return this.userGroups; + } + + /** The UserSubscriptionsClient object to access its operations. */ + private final UserSubscriptionsClient userSubscriptions; + + /** + * Gets the UserSubscriptionsClient object to access its operations. + * + * @return the UserSubscriptionsClient object. + */ + public UserSubscriptionsClient getUserSubscriptions() { + return this.userSubscriptions; + } + + /** The UserIdentitiesClient object to access its operations. */ + private final UserIdentitiesClient userIdentities; + + /** + * Gets the UserIdentitiesClient object to access its operations. + * + * @return the UserIdentitiesClient object. + */ + public UserIdentitiesClient getUserIdentities() { + return this.userIdentities; + } + + /** The UserConfirmationPasswordsClient object to access its operations. */ + private final UserConfirmationPasswordsClient userConfirmationPasswords; + + /** + * Gets the UserConfirmationPasswordsClient object to access its operations. + * + * @return the UserConfirmationPasswordsClient object. + */ + public UserConfirmationPasswordsClient getUserConfirmationPasswords() { + return this.userConfirmationPasswords; + } + + /** + * Initializes an instance of ApiManagementClient 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 Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ApiManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-12-01"; + this.apis = new ApisClientImpl(this); + this.apiRevisions = new ApiRevisionsClientImpl(this); + this.apiReleases = new ApiReleasesClientImpl(this); + this.apiOperations = new ApiOperationsClientImpl(this); + this.apiOperationPolicies = new ApiOperationPoliciesClientImpl(this); + this.tags = new TagsClientImpl(this); + this.apiProducts = new ApiProductsClientImpl(this); + this.apiPolicies = new ApiPoliciesClientImpl(this); + this.apiSchemas = new ApiSchemasClientImpl(this); + this.apiDiagnostics = new ApiDiagnosticsClientImpl(this); + this.apiIssues = new ApiIssuesClientImpl(this); + this.apiIssueComments = new ApiIssueCommentsClientImpl(this); + this.apiIssueAttachments = new ApiIssueAttachmentsClientImpl(this); + this.apiTagDescriptions = new ApiTagDescriptionsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.apiExports = new ApiExportsClientImpl(this); + this.apiVersionSets = new ApiVersionSetsClientImpl(this); + this.authorizationServers = new AuthorizationServersClientImpl(this); + this.backends = new BackendsClientImpl(this); + this.caches = new CachesClientImpl(this); + this.certificates = new CertificatesClientImpl(this); + this.contentTypes = new ContentTypesClientImpl(this); + this.contentItems = new ContentItemsClientImpl(this); + this.deletedServices = new DeletedServicesClientImpl(this); + this.apiManagementOperations = new ApiManagementOperationsClientImpl(this); + this.apiManagementServiceSkus = new ApiManagementServiceSkusClientImpl(this); + this.apiManagementServices = new ApiManagementServicesClientImpl(this); + this.diagnostics = new DiagnosticsClientImpl(this); + this.emailTemplates = new EmailTemplatesClientImpl(this); + this.gateways = new GatewaysClientImpl(this); + this.gatewayHostnameConfigurations = new GatewayHostnameConfigurationsClientImpl(this); + this.gatewayApis = new GatewayApisClientImpl(this); + this.gatewayCertificateAuthorities = new GatewayCertificateAuthoritiesClientImpl(this); + this.groups = new GroupsClientImpl(this); + this.groupUsers = new GroupUsersClientImpl(this); + this.identityProviders = new IdentityProvidersClientImpl(this); + this.issues = new IssuesClientImpl(this); + this.loggers = new LoggersClientImpl(this); + this.namedValues = new NamedValuesClientImpl(this); + this.networkStatus = new NetworkStatusClientImpl(this); + this.notifications = new NotificationsClientImpl(this); + this.notificationRecipientUsers = new NotificationRecipientUsersClientImpl(this); + this.notificationRecipientEmails = new NotificationRecipientEmailsClientImpl(this); + this.openIdConnectProviders = new OpenIdConnectProvidersClientImpl(this); + this.policies = new PoliciesClientImpl(this); + this.policyDescriptions = new PolicyDescriptionsClientImpl(this); + this.portalRevisions = new PortalRevisionsClientImpl(this); + this.portalSettings = new PortalSettingsClientImpl(this); + this.signInSettings = new SignInSettingsClientImpl(this); + this.signUpSettings = new SignUpSettingsClientImpl(this); + this.delegationSettings = new DelegationSettingsClientImpl(this); + this.products = new ProductsClientImpl(this); + this.productApis = new ProductApisClientImpl(this); + this.productGroups = new ProductGroupsClientImpl(this); + this.productSubscriptions = new ProductSubscriptionsClientImpl(this); + this.productPolicies = new ProductPoliciesClientImpl(this); + this.quotaByCounterKeys = new QuotaByCounterKeysClientImpl(this); + this.quotaByPeriodKeys = new QuotaByPeriodKeysClientImpl(this); + this.regions = new RegionsClientImpl(this); + this.reports = new ReportsClientImpl(this); + this.tenantSettings = new TenantSettingsClientImpl(this); + this.apiManagementSkus = new ApiManagementSkusClientImpl(this); + this.subscriptions = new SubscriptionsClientImpl(this); + this.tagResources = new TagResourcesClientImpl(this); + this.tenantAccess = new TenantAccessClientImpl(this); + this.tenantAccessGits = new TenantAccessGitsClientImpl(this); + this.tenantConfigurations = new TenantConfigurationsClientImpl(this); + this.users = new UsersClientImpl(this); + this.userGroups = new UserGroupsClientImpl(this); + this.userSubscriptions = new UserSubscriptionsClientImpl(this); + this.userIdentities = new UserIdentitiesClientImpl(this); + this.userConfirmationPasswords = new UserConfirmationPasswordsClientImpl(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsClientImpl.java new file mode 100644 index 0000000000000..b46cd373c2284 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiManagementOperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationInner; +import com.azure.resourcemanager.apimanagement.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiManagementOperationsClient. */ +public final class ApiManagementOperationsClientImpl implements ApiManagementOperationsClient { + private final ClientLogger logger = new ClientLogger(ApiManagementOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiManagementOperationsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiManagementOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiManagementOperationsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(ApiManagementOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiManagementOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiManagementOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ApiManagement/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsImpl.java new file mode 100644 index 0000000000000..772345ba6714f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementOperationsImpl.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.apimanagement.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.apimanagement.fluent.ApiManagementOperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementOperations; +import com.azure.resourcemanager.apimanagement.models.Operation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiManagementOperationsImpl implements ApiManagementOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementOperationsImpl.class); + + private final ApiManagementOperationsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiManagementOperationsImpl( + ApiManagementOperationsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private ApiManagementOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetDomainOwnershipIdentifierResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetDomainOwnershipIdentifierResultImpl.java new file mode 100644 index 0000000000000..d2f2d384d9de8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetDomainOwnershipIdentifierResultImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetDomainOwnershipIdentifierResultInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult; + +public final class ApiManagementServiceGetDomainOwnershipIdentifierResultImpl + implements ApiManagementServiceGetDomainOwnershipIdentifierResult { + private ApiManagementServiceGetDomainOwnershipIdentifierResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ApiManagementServiceGetDomainOwnershipIdentifierResultImpl( + ApiManagementServiceGetDomainOwnershipIdentifierResultInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String domainOwnershipIdentifier() { + return this.innerModel().domainOwnershipIdentifier(); + } + + public ApiManagementServiceGetDomainOwnershipIdentifierResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetSsoTokenResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetSsoTokenResultImpl.java new file mode 100644 index 0000000000000..6ddd033a6ae7e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceGetSsoTokenResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetSsoTokenResultInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceGetSsoTokenResult; + +public final class ApiManagementServiceGetSsoTokenResultImpl implements ApiManagementServiceGetSsoTokenResult { + private ApiManagementServiceGetSsoTokenResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ApiManagementServiceGetSsoTokenResultImpl( + ApiManagementServiceGetSsoTokenResultInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String redirectUri() { + return this.innerModel().redirectUri(); + } + + public ApiManagementServiceGetSsoTokenResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceNameAvailabilityResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..ddbff4e3f1a84 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceNameAvailabilityResultImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceNameAvailabilityResultInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceNameAvailabilityResult; +import com.azure.resourcemanager.apimanagement.models.NameAvailabilityReason; + +public final class ApiManagementServiceNameAvailabilityResultImpl + implements ApiManagementServiceNameAvailabilityResult { + private ApiManagementServiceNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ApiManagementServiceNameAvailabilityResultImpl( + ApiManagementServiceNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public ApiManagementServiceNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceResourceImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceResourceImpl.java new file mode 100644 index 0000000000000..fd161ed5dc220 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceResourceImpl.java @@ -0,0 +1,528 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceResourceInner; +import com.azure.resourcemanager.apimanagement.models.AdditionalLocation; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceBackupRestoreParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceGetSsoTokenResult; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceIdentity; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceResource; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.ApiVersionConstraint; +import com.azure.resourcemanager.apimanagement.models.CertificateConfiguration; +import com.azure.resourcemanager.apimanagement.models.HostnameConfiguration; +import com.azure.resourcemanager.apimanagement.models.VirtualNetworkConfiguration; +import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApiManagementServiceResourceImpl + implements ApiManagementServiceResource, + ApiManagementServiceResource.Definition, + ApiManagementServiceResource.Update { + private ApiManagementServiceResourceInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApiManagementServiceSkuProperties sku() { + return this.innerModel().sku(); + } + + public ApiManagementServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String location() { + return this.innerModel().location(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public List zones() { + List inner = this.innerModel().zones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String notificationSenderEmail() { + return this.innerModel().notificationSenderEmail(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String targetProvisioningState() { + return this.innerModel().targetProvisioningState(); + } + + public OffsetDateTime createdAtUtc() { + return this.innerModel().createdAtUtc(); + } + + public String gatewayUrl() { + return this.innerModel().gatewayUrl(); + } + + public String gatewayRegionalUrl() { + return this.innerModel().gatewayRegionalUrl(); + } + + public String portalUrl() { + return this.innerModel().portalUrl(); + } + + public String managementApiUrl() { + return this.innerModel().managementApiUrl(); + } + + public String scmUrl() { + return this.innerModel().scmUrl(); + } + + public String developerPortalUrl() { + return this.innerModel().developerPortalUrl(); + } + + public List hostnameConfigurations() { + List inner = this.innerModel().hostnameConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List publicIpAddresses() { + List inner = this.innerModel().publicIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateIpAddresses() { + List inner = this.innerModel().privateIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.innerModel().virtualNetworkConfiguration(); + } + + public List additionalLocations() { + List inner = this.innerModel().additionalLocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map customProperties() { + Map inner = this.innerModel().customProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List certificates() { + List inner = this.innerModel().certificates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableClientCertificate() { + return this.innerModel().enableClientCertificate(); + } + + public Boolean disableGateway() { + return this.innerModel().disableGateway(); + } + + public VirtualNetworkType virtualNetworkType() { + return this.innerModel().virtualNetworkType(); + } + + public ApiVersionConstraint apiVersionConstraint() { + return this.innerModel().apiVersionConstraint(); + } + + public Boolean restore() { + return this.innerModel().restore(); + } + + public String publisherEmail() { + return this.innerModel().publisherEmail(); + } + + public String publisherName() { + return this.innerModel().publisherName(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ApiManagementServiceResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private ApiManagementServiceUpdateParameters updateParameters; + + public ApiManagementServiceResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApiManagementServiceResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiManagementServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public ApiManagementServiceResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiManagementServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), context); + return this; + } + + ApiManagementServiceResourceImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new ApiManagementServiceResourceInner(); + this.serviceManager = serviceManager; + this.serviceName = name; + } + + public ApiManagementServiceResourceImpl update() { + this.updateParameters = new ApiManagementServiceUpdateParameters(); + return this; + } + + public ApiManagementServiceResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiManagementServices() + .update(resourceGroupName, serviceName, updateParameters, Context.NONE); + return this; + } + + public ApiManagementServiceResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiManagementServices() + .update(resourceGroupName, serviceName, updateParameters, context); + return this; + } + + ApiManagementServiceResourceImpl( + ApiManagementServiceResourceInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + } + + public ApiManagementServiceResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiManagementServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, Context.NONE) + .getValue(); + return this; + } + + public ApiManagementServiceResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiManagementServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, context) + .getValue(); + return this; + } + + public ApiManagementServiceResource backup(ApiManagementServiceBackupRestoreParameters parameters) { + return serviceManager.apiManagementServices().backup(resourceGroupName, serviceName, parameters); + } + + public ApiManagementServiceResource backup( + ApiManagementServiceBackupRestoreParameters parameters, Context context) { + return serviceManager.apiManagementServices().backup(resourceGroupName, serviceName, parameters, context); + } + + public ApiManagementServiceGetSsoTokenResult getSsoToken() { + return serviceManager.apiManagementServices().getSsoToken(resourceGroupName, serviceName); + } + + public Response getSsoTokenWithResponse(Context context) { + return serviceManager.apiManagementServices().getSsoTokenWithResponse(resourceGroupName, serviceName, context); + } + + public ApiManagementServiceResource applyNetworkConfigurationUpdates( + ApiManagementServiceApplyNetworkConfigurationParameters parameters) { + return serviceManager + .apiManagementServices() + .applyNetworkConfigurationUpdates(resourceGroupName, serviceName, parameters); + } + + public ApiManagementServiceResource applyNetworkConfigurationUpdates() { + return serviceManager.apiManagementServices().applyNetworkConfigurationUpdates(resourceGroupName, serviceName); + } + + public ApiManagementServiceResource applyNetworkConfigurationUpdates( + ApiManagementServiceApplyNetworkConfigurationParameters parameters, Context context) { + return serviceManager + .apiManagementServices() + .applyNetworkConfigurationUpdates(resourceGroupName, serviceName, parameters, context); + } + + public ApiManagementServiceResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApiManagementServiceResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApiManagementServiceResourceImpl withSku(ApiManagementServiceSkuProperties sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public ApiManagementServiceResourceImpl withPublisherEmail(String publisherEmail) { + if (isInCreateMode()) { + this.innerModel().withPublisherEmail(publisherEmail); + return this; + } else { + this.updateParameters.withPublisherEmail(publisherEmail); + return this; + } + } + + public ApiManagementServiceResourceImpl withPublisherName(String publisherName) { + if (isInCreateMode()) { + this.innerModel().withPublisherName(publisherName); + return this; + } else { + this.updateParameters.withPublisherName(publisherName); + return this; + } + } + + public ApiManagementServiceResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApiManagementServiceResourceImpl withIdentity(ApiManagementServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public ApiManagementServiceResourceImpl withZones(List zones) { + this.innerModel().withZones(zones); + return this; + } + + public ApiManagementServiceResourceImpl withNotificationSenderEmail(String notificationSenderEmail) { + if (isInCreateMode()) { + this.innerModel().withNotificationSenderEmail(notificationSenderEmail); + return this; + } else { + this.updateParameters.withNotificationSenderEmail(notificationSenderEmail); + return this; + } + } + + public ApiManagementServiceResourceImpl withHostnameConfigurations( + List hostnameConfigurations) { + if (isInCreateMode()) { + this.innerModel().withHostnameConfigurations(hostnameConfigurations); + return this; + } else { + this.updateParameters.withHostnameConfigurations(hostnameConfigurations); + return this; + } + } + + public ApiManagementServiceResourceImpl withVirtualNetworkConfiguration( + VirtualNetworkConfiguration virtualNetworkConfiguration) { + if (isInCreateMode()) { + this.innerModel().withVirtualNetworkConfiguration(virtualNetworkConfiguration); + return this; + } else { + this.updateParameters.withVirtualNetworkConfiguration(virtualNetworkConfiguration); + return this; + } + } + + public ApiManagementServiceResourceImpl withAdditionalLocations(List additionalLocations) { + if (isInCreateMode()) { + this.innerModel().withAdditionalLocations(additionalLocations); + return this; + } else { + this.updateParameters.withAdditionalLocations(additionalLocations); + return this; + } + } + + public ApiManagementServiceResourceImpl withCustomProperties(Map customProperties) { + if (isInCreateMode()) { + this.innerModel().withCustomProperties(customProperties); + return this; + } else { + this.updateParameters.withCustomProperties(customProperties); + return this; + } + } + + public ApiManagementServiceResourceImpl withCertificates(List certificates) { + if (isInCreateMode()) { + this.innerModel().withCertificates(certificates); + return this; + } else { + this.updateParameters.withCertificates(certificates); + return this; + } + } + + public ApiManagementServiceResourceImpl withEnableClientCertificate(Boolean enableClientCertificate) { + if (isInCreateMode()) { + this.innerModel().withEnableClientCertificate(enableClientCertificate); + return this; + } else { + this.updateParameters.withEnableClientCertificate(enableClientCertificate); + return this; + } + } + + public ApiManagementServiceResourceImpl withDisableGateway(Boolean disableGateway) { + if (isInCreateMode()) { + this.innerModel().withDisableGateway(disableGateway); + return this; + } else { + this.updateParameters.withDisableGateway(disableGateway); + return this; + } + } + + public ApiManagementServiceResourceImpl withVirtualNetworkType(VirtualNetworkType virtualNetworkType) { + if (isInCreateMode()) { + this.innerModel().withVirtualNetworkType(virtualNetworkType); + return this; + } else { + this.updateParameters.withVirtualNetworkType(virtualNetworkType); + return this; + } + } + + public ApiManagementServiceResourceImpl withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint) { + if (isInCreateMode()) { + this.innerModel().withApiVersionConstraint(apiVersionConstraint); + return this; + } else { + this.updateParameters.withApiVersionConstraint(apiVersionConstraint); + return this; + } + } + + public ApiManagementServiceResourceImpl withRestore(Boolean restore) { + if (isInCreateMode()) { + this.innerModel().withRestore(restore); + return this; + } else { + this.updateParameters.withRestore(restore); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusClientImpl.java new file mode 100644 index 0000000000000..ce4e0ff1187ff --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusClientImpl.java @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiManagementServiceSkusClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ResourceSkuResultInner; +import com.azure.resourcemanager.apimanagement.models.ResourceSkuResults; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiManagementServiceSkusClient. */ +public final class ApiManagementServiceSkusClientImpl implements ApiManagementServiceSkusClient { + private final ClientLogger logger = new ClientLogger(ApiManagementServiceSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiManagementServiceSkusService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiManagementServiceSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiManagementServiceSkusClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(ApiManagementServiceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiManagementServiceSkus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiManagementServiceSkusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableServiceSkus( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAvailableServiceSkusNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableServiceSkusSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAvailableServiceSkus( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableServiceSkusSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAvailableServiceSkus( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableServiceSkusAsync( + String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listAvailableServiceSkusSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listAvailableServiceSkusNextSinglePageAsync(nextLink)); + } + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAvailableServiceSkusAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listAvailableServiceSkusSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listAvailableServiceSkusNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableServiceSkus( + String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAvailableServiceSkusAsync(resourceGroupName, serviceName)); + } + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAvailableServiceSkus( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAvailableServiceSkusAsync(resourceGroupName, serviceName, 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 the API Management service SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableServiceSkusNextSinglePageAsync(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.listAvailableServiceSkusNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API Management service SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableServiceSkusNextSinglePageAsync( + 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 + .listAvailableServiceSkusNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusImpl.java new file mode 100644 index 0000000000000..d8cbfddde840c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServiceSkusImpl.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.apimanagement.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.apimanagement.fluent.ApiManagementServiceSkusClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ResourceSkuResultInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkus; +import com.azure.resourcemanager.apimanagement.models.ResourceSkuResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiManagementServiceSkusImpl implements ApiManagementServiceSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceSkusImpl.class); + + private final ApiManagementServiceSkusClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiManagementServiceSkusImpl( + ApiManagementServiceSkusClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listAvailableServiceSkus(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listAvailableServiceSkus(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ResourceSkuResultImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableServiceSkus( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listAvailableServiceSkus(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ResourceSkuResultImpl(inner1, this.manager())); + } + + private ApiManagementServiceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesClientImpl.java new file mode 100644 index 0000000000000..6c12a97d6f43b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesClientImpl.java @@ -0,0 +1,3049 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.apimanagement.fluent.ApiManagementServicesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetDomainOwnershipIdentifierResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetSsoTokenResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceNameAvailabilityResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceResourceInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceBackupRestoreParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceCheckNameAvailabilityParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceListResult; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceUpdateParameters; +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 ApiManagementServicesClient. */ +public final class ApiManagementServicesClientImpl implements ApiManagementServicesClient { + private final ClientLogger logger = new ClientLogger(ApiManagementServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiManagementServicesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiManagementServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiManagementServicesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(ApiManagementServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiManagementServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiManagementServicesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/restore") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restore( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiManagementServiceBackupRestoreParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiManagementServiceBackupRestoreParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiManagementServiceResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiManagementServiceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/getssotoken") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSsoToken( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiManagementServiceCheckNameAvailabilityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDomainOwnershipIdentifier( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/applynetworkconfigurationupdates") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> applyNetworkConfigurationUpdates( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiManagementServiceApplyNetworkConfigurationParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restore( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restore( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginRestoreAsync( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + Mono>> mono = restoreWithResponseAsync(resourceGroupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + Context.NONE); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginRestoreAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restoreWithResponseAsync(resourceGroupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + context); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginRestore( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + return beginRestoreAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginRestore( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + return beginRestoreAsync(resourceGroupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + return beginRestoreAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + return beginRestoreAsync(resourceGroupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner restore( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + return restoreAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner restore( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + return restoreAsync(resourceGroupName, serviceName, parameters, context).block(); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backupWithResponseAsync( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .backup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backupWithResponseAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .backup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginBackupAsync( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + Mono>> mono = backupWithResponseAsync(resourceGroupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + Context.NONE); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginBackupAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + backupWithResponseAsync(resourceGroupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + context); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginBackup( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + return beginBackupAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginBackup( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + return beginBackupAsync(resourceGroupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backupAsync( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + return beginBackupAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backupAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + return beginBackupAsync(resourceGroupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner backup( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + return backupAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner backup( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + return backupAsync(resourceGroupName, serviceName, parameters, context).block(); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + Context.NONE); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + context); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> + beginCreateOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + ApiManagementServiceResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Creates or updates an API Management service. This is long running operation and could take several minutes to + * complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceResourceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, parameters, context).block(); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginUpdateAsync( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + Context.NONE); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginUpdateAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + context); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + ApiManagementServiceUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner update( + String resourceGroupName, String serviceName, ApiManagementServiceUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Updates an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the CreateOrUpdate API Management service operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner update( + String resourceGroupName, + String serviceName, + ApiManagementServiceUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, serviceName, parameters, context).block(); + } + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String serviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName) { + return getByResourceGroupAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginDeleteAsync(String resourceGroupName, String serviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + Context.NONE); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginDeleteAsync(String resourceGroupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + context); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginDelete( + String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> beginDelete( + String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner delete(String resourceGroupName, String serviceName) { + return deleteAsync(resourceGroupName, serviceName).block(); + } + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner delete(String resourceGroupName, String serviceName, Context context) { + return deleteAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSsoTokenWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSsoToken( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSsoTokenWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSsoToken( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSsoTokenAsync( + String resourceGroupName, String serviceName) { + return getSsoTokenWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceGetSsoTokenResultInner getSsoToken(String resourceGroupName, String serviceName) { + return getSsoTokenAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSsoTokenWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getSsoTokenWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + ApiManagementServiceCheckNameAvailabilityParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + ApiManagementServiceCheckNameAvailabilityParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + ApiManagementServiceCheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceNameAvailabilityResultInner checkNameAvailability( + ApiManagementServiceCheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityAsync(parameters).block(); + } + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + ApiManagementServiceCheckNameAvailabilityParameters parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(parameters, context).block(); + } + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDomainOwnershipIdentifierWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDomainOwnershipIdentifier( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDomainOwnershipIdentifierWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDomainOwnershipIdentifier( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDomainOwnershipIdentifierAsync() { + return getDomainOwnershipIdentifierWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceGetDomainOwnershipIdentifierResultInner getDomainOwnershipIdentifier() { + return getDomainOwnershipIdentifierAsync().block(); + } + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getDomainOwnershipIdentifierWithResponse(Context context) { + return getDomainOwnershipIdentifierWithResponseAsync(context).block(); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyNetworkConfigurationUpdatesWithResponseAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and 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) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .applyNetworkConfigurationUpdates( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyNetworkConfigurationUpdatesWithResponseAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and 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) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .applyNetworkConfigurationUpdates( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginApplyNetworkConfigurationUpdatesAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters) { + Mono>> mono = + applyNetworkConfigurationUpdatesWithResponseAsync(resourceGroupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + Context.NONE); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiManagementServiceResourceInner> + beginApplyNetworkConfigurationUpdatesAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + applyNetworkConfigurationUpdatesWithResponseAsync(resourceGroupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiManagementServiceResourceInner.class, + ApiManagementServiceResourceInner.class, + context); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> + beginApplyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters) { + return beginApplyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters).getSyncPoller(); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiManagementServiceResourceInner> + beginApplyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context) { + return beginApplyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyNetworkConfigurationUpdatesAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters) { + return beginApplyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyNetworkConfigurationUpdatesAsync( + String resourceGroupName, String serviceName) { + final ApiManagementServiceApplyNetworkConfigurationParameters parameters = null; + return beginApplyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyNetworkConfigurationUpdatesAsync( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context) { + return beginApplyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters) { + return applyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner applyNetworkConfigurationUpdates( + String resourceGroupName, String serviceName) { + final ApiManagementServiceApplyNetworkConfigurationParameters parameters = null; + return applyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters).block(); + } + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiManagementServiceResourceInner applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context) { + return applyNetworkConfigurationUpdatesAsync(resourceGroupName, serviceName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesImpl.java new file mode 100644 index 0000000000000..e3cce89e92b02 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementServicesImpl.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiManagementServicesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetDomainOwnershipIdentifierResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetSsoTokenResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceNameAvailabilityResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceResourceInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceBackupRestoreParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceCheckNameAvailabilityParameters; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceGetSsoTokenResult; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceNameAvailabilityResult; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceResource; +import com.azure.resourcemanager.apimanagement.models.ApiManagementServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiManagementServicesImpl implements ApiManagementServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServicesImpl.class); + + private final ApiManagementServicesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiManagementServicesImpl( + ApiManagementServicesClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ApiManagementServiceResource restore( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + ApiManagementServiceResourceInner inner = + this.serviceClient().restore(resourceGroupName, serviceName, parameters); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource restore( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + ApiManagementServiceResourceInner inner = + this.serviceClient().restore(resourceGroupName, serviceName, parameters, context); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource backup( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters) { + ApiManagementServiceResourceInner inner = + this.serviceClient().backup(resourceGroupName, serviceName, parameters); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource backup( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context) { + ApiManagementServiceResourceInner inner = + this.serviceClient().backup(resourceGroupName, serviceName, parameters, context); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource getByResourceGroup(String resourceGroupName, String serviceName) { + ApiManagementServiceResourceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, serviceName); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiManagementServiceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiManagementServiceResource deleteByResourceGroup(String resourceGroupName, String serviceName) { + ApiManagementServiceResourceInner inner = this.serviceClient().delete(resourceGroupName, serviceName); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource delete(String resourceGroupName, String serviceName, Context context) { + ApiManagementServiceResourceInner inner = this.serviceClient().delete(resourceGroupName, serviceName, context); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApiManagementServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApiManagementServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApiManagementServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApiManagementServiceResourceImpl(inner1, this.manager())); + } + + public ApiManagementServiceGetSsoTokenResult getSsoToken(String resourceGroupName, String serviceName) { + ApiManagementServiceGetSsoTokenResultInner inner = + this.serviceClient().getSsoToken(resourceGroupName, serviceName); + if (inner != null) { + return new ApiManagementServiceGetSsoTokenResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSsoTokenWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getSsoTokenWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiManagementServiceGetSsoTokenResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiManagementServiceNameAvailabilityResult checkNameAvailability( + ApiManagementServiceCheckNameAvailabilityParameters parameters) { + ApiManagementServiceNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(parameters); + if (inner != null) { + return new ApiManagementServiceNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + ApiManagementServiceCheckNameAvailabilityParameters parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiManagementServiceNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiManagementServiceGetDomainOwnershipIdentifierResult getDomainOwnershipIdentifier() { + ApiManagementServiceGetDomainOwnershipIdentifierResultInner inner = + this.serviceClient().getDomainOwnershipIdentifier(); + if (inner != null) { + return new ApiManagementServiceGetDomainOwnershipIdentifierResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDomainOwnershipIdentifierWithResponse( + Context context) { + Response inner = + this.serviceClient().getDomainOwnershipIdentifierWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiManagementServiceGetDomainOwnershipIdentifierResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiManagementServiceResource applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters) { + ApiManagementServiceResourceInner inner = + this.serviceClient().applyNetworkConfigurationUpdates(resourceGroupName, serviceName, parameters); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource applyNetworkConfigurationUpdates(String resourceGroupName, String serviceName) { + ApiManagementServiceResourceInner inner = + this.serviceClient().applyNetworkConfigurationUpdates(resourceGroupName, serviceName); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context) { + ApiManagementServiceResourceInner inner = + this.serviceClient().applyNetworkConfigurationUpdates(resourceGroupName, serviceName, parameters, context); + if (inner != null) { + return new ApiManagementServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiManagementServiceResource 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, context); + } + + public ApiManagementServiceResource 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + return this.delete(resourceGroupName, serviceName, Context.NONE); + } + + public ApiManagementServiceResource 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + return this.delete(resourceGroupName, serviceName, context); + } + + private ApiManagementServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public ApiManagementServiceResourceImpl define(String name) { + return new ApiManagementServiceResourceImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkuImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkuImpl.java new file mode 100644 index 0000000000000..1afacea38287a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkuImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementSkuInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSku; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuCapabilities; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuCapacity; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuCosts; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuLocationInfo; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkuRestrictions; +import java.util.Collections; +import java.util.List; + +public final class ApiManagementSkuImpl implements ApiManagementSku { + private ApiManagementSkuInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ApiManagementSkuImpl( + ApiManagementSkuInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public String size() { + return this.innerModel().size(); + } + + public String family() { + return this.innerModel().family(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ApiManagementSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List apiVersions() { + List inner = this.innerModel().apiVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List costs() { + List inner = this.innerModel().costs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApiManagementSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusClientImpl.java new file mode 100644 index 0000000000000..6500d186f00b0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusClientImpl.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiManagementSkusClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementSkuInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkusResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiManagementSkusClient. */ +public final class ApiManagementSkusClientImpl implements ApiManagementSkusClient { + private final ClientLogger logger = new ClientLogger(ApiManagementSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiManagementSkusService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiManagementSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiManagementSkusClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiManagementSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiManagementSkus to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiManagementSkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your 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 the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your 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 the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your 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 the list of Microsoft. + */ + @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 the List Resource Skus operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Resource Skus operation response. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusImpl.java new file mode 100644 index 0000000000000..b5d4cc20f959d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiManagementSkusImpl.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.apimanagement.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.apimanagement.fluent.ApiManagementSkusClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementSkuInner; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSku; +import com.azure.resourcemanager.apimanagement.models.ApiManagementSkus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiManagementSkusImpl implements ApiManagementSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkusImpl.class); + + private final ApiManagementSkusClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiManagementSkusImpl( + ApiManagementSkusClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApiManagementSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApiManagementSkuImpl(inner1, this.manager())); + } + + private ApiManagementSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesClientImpl.java new file mode 100644 index 0000000000000..8ceb9d050ce14 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesClientImpl.java @@ -0,0 +1,1345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.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.apimanagement.fluent.ApiOperationPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiOperationPoliciesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiOperationPoliciesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiOperationPoliciesGetResponse; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiOperationPoliciesClient. */ +public final class ApiOperationPoliciesClientImpl implements ApiOperationPoliciesClient { + private final ClientLogger logger = new ClientLogger(ApiOperationPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiOperationPoliciesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiOperationPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiOperationPoliciesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(ApiOperationPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiOperationPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiOperationPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @QueryParam("format") PolicyExportFormat format, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PolicyContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByOperationAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + return listByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyCollectionInner listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId) { + return listByOperationAsync(resourceGroupName, serviceName, apiId, operationId).block(); + } + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + return listByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, context).block(); + } + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 entity state (Etag) version of the API operation policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 entity state (Etag) version of the API operation policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 entity state (Etag) version of the API operation policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId) + .flatMap((ApiOperationPoliciesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 getEntityTag( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, operationId, policyId).block(); + } + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 entity state (Etag) version of the API operation policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId, context) + .block(); + } + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + format, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + format, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId, format) + .flatMap( + (ApiOperationPoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId, format) + .flatMap( + (ApiOperationPoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner get( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getAsync(resourceGroupName, serviceName, apiId, operationId, policyId, format).block(); + } + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId, format, context) + .block(); + } + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, operationId, policyId, parameters, ifMatch) + .flatMap( + (ApiOperationPoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, operationId, policyId, parameters, ifMatch) + .flatMap( + (ApiOperationPoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, operationId, policyId, parameters, ifMatch) + .block(); + } + + /** + * Creates or updates policy configuration for the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, operationId, policyId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch).block(); + } + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch, context) + .block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesImpl.java new file mode 100644 index 0000000000000..b3a15f7d3628c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationPoliciesImpl.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiOperationPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiOperationPolicies; +import com.azure.resourcemanager.apimanagement.models.PolicyCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyContract; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiOperationPoliciesImpl implements ApiOperationPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationPoliciesImpl.class); + + private final ApiOperationPoliciesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiOperationPoliciesImpl( + ApiOperationPoliciesClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PolicyCollection listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId) { + PolicyCollectionInner inner = + this.serviceClient().listByOperation(resourceGroupName, serviceName, apiId, operationId); + if (inner != null) { + return new PolicyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + Response inner = + this + .serviceClient() + .listByOperationWithResponse(resourceGroupName, serviceName, apiId, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void getEntityTag( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, operationId, policyId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, context); + } + + public PolicyContract get( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId) { + PolicyContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, apiId, operationId, policyId); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, format, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch, context); + } + + public PolicyContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + PolicyIdName policyId = PolicyIdName.fromString(Utils.getValueFromIdByName(id, "policies")); + if (policyId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); + } + PolicyExportFormat localFormat = null; + return this + .getWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, localFormat, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, PolicyExportFormat format, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + PolicyIdName policyId = PolicyIdName.fromString(Utils.getValueFromIdByName(id, "policies")); + if (policyId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, format, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + PolicyIdName policyId = PolicyIdName.fromString(Utils.getValueFromIdByName(id, "policies")); + if (policyId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse( + resourceGroupName, serviceName, apiId, operationId, policyId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + PolicyIdName policyId = PolicyIdName.fromString(Utils.getValueFromIdByName(id, "policies")); + if (policyId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'policies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, ifMatch, context); + } + + private ApiOperationPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public PolicyContractImpl define(PolicyIdName name) { + return new PolicyContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsClientImpl.java new file mode 100644 index 0000000000000..ca3054f0262d6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsClientImpl.java @@ -0,0 +1,1677 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiOperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiOperationsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiOperationsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiOperationsGetResponse; +import com.azure.resourcemanager.apimanagement.models.ApiOperationsUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.OperationCollection; +import com.azure.resourcemanager.apimanagement.models.OperationUpdateContract; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiOperationsClient. */ +public final class ApiOperationsClientImpl implements ApiOperationsClient { + private final ClientLogger logger = new ClientLogger(ApiOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiOperationsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiOperationsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("tags") String tags, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OperationContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OperationUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApiNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + tags, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + tags, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, tags), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String tags = null; + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, tags), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags, + Context context) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, tags, context), + nextLink -> listByApiNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String tags = null; + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, apiId, filter, top, skip, tags)); + } + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags, + Context context) { + return new PagedIterable<>( + listByApiAsync(resourceGroupName, serviceName, apiId, filter, top, skip, tags, context)); + } + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, operationId) + .flatMap((ApiOperationsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String operationId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, operationId).block(); + } + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, context).block(); + } + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, operationId) + .flatMap( + (ApiOperationsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationContractInner get(String resourceGroupName, String serviceName, String apiId, String operationId) { + return getAsync(resourceGroupName, serviceName, apiId, operationId).block(); + } + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, context).block(); + } + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch) + .flatMap( + (ApiOperationsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch) + .flatMap( + (ApiOperationsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch).block(); + } + + /** + * Creates a new operation in the API or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + OperationContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, operationId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, ifMatch, parameters) + .flatMap( + (ApiOperationsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, apiId, operationId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the operation in the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Operation Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Operation details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + OperationUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String operationId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String operationId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String operationId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String operationId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, operationId, ifMatch).block(); + } + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, ifMatch, 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 paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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.listByApiNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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 + .listByApiNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsImpl.java new file mode 100644 index 0000000000000..c9b07247234ac --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiOperationsImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiOperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiOperations; +import com.azure.resourcemanager.apimanagement.models.OperationContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiOperationsImpl implements ApiOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationsImpl.class); + + private final ApiOperationsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiOperationsImpl( + ApiOperationsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new OperationContractImpl(inner1, this.manager())); + } + + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags, + Context context) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, apiId, filter, top, skip, tags, context); + return Utils.mapPage(inner, inner1 -> new OperationContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, String operationId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, operationId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, apiId, operationId, context); + } + + public OperationContract get(String resourceGroupName, String serviceName, String apiId, String operationId) { + OperationContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, operationId); + if (inner != null) { + return new OperationContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiId, String operationId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, operationId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, operationId, ifMatch, context); + } + + public OperationContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, operationId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, operationId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, operationId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String operationId = Utils.getValueFromIdByName(id, "operations"); + if (operationId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'operations'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, operationId, ifMatch, context); + } + + private ApiOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public OperationContractImpl define(String name) { + return new OperationContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesClientImpl.java new file mode 100644 index 0000000000000..306270b861d67 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesClientImpl.java @@ -0,0 +1,1192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.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.apimanagement.fluent.ApiPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiPoliciesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiPoliciesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiPoliciesGetResponse; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiPoliciesClient. */ +public final class ApiPoliciesClientImpl implements ApiPoliciesClient { + private final ClientLogger logger = new ClientLogger(ApiPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiPoliciesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiPoliciesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/policies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/policies/{policyId}") + @ExpectedResponses({200, 200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("format") PolicyExportFormat format, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/policies/{policyId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PolicyContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/policies/{policyId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByApiAsync(String resourceGroupName, String serviceName, String apiId) { + return listByApiWithResponseAsync(resourceGroupName, serviceName, apiId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyCollectionInner listByApi(String resourceGroupName, String serviceName, String apiId) { + return listByApiAsync(resourceGroupName, serviceName, apiId).block(); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return listByApiWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); + } + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 entity state (Etag) version of the API policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 entity state (Etag) version of the API policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 entity state (Etag) version of the API policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, policyId) + .flatMap((ApiPoliciesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, policyId).block(); + } + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 entity state (Etag) version of the API policy specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, context).block(); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, PolicyExportFormat format) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = + "application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + format, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = + "application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + format, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, PolicyExportFormat format) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, format) + .flatMap( + (ApiPoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, format) + .flatMap( + (ApiPoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner get(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getAsync(resourceGroupName, serviceName, apiId, policyId, format).block(); + } + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, format, context).block(); + } + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, parameters, ifMatch) + .flatMap( + (ApiPoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, parameters, ifMatch) + .flatMap( + (ApiPoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, policyId, parameters, ifMatch).block(); + } + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, policyId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, PolicyIdName policyId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + PolicyIdName policyId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, PolicyIdName policyId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, PolicyIdName policyId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, policyId, ifMatch).block(); + } + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, policyId, ifMatch, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesImpl.java new file mode 100644 index 0000000000000..84ec1ce2eb48d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiPoliciesImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiPolicies; +import com.azure.resourcemanager.apimanagement.models.PolicyCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyContract; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiPoliciesImpl implements ApiPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPoliciesImpl.class); + + private final ApiPoliciesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiPoliciesImpl( + ApiPoliciesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PolicyCollection listByApi(String resourceGroupName, String serviceName, String apiId) { + PolicyCollectionInner inner = this.serviceClient().listByApi(resourceGroupName, serviceName, apiId); + if (inner != null) { + return new PolicyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + Response inner = + this.serviceClient().listByApiWithResponse(resourceGroupName, serviceName, apiId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, policyId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, apiId, policyId, context); + } + + public PolicyContract get(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId) { + PolicyContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, policyId); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, policyId, format, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PolicyContract createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters) { + PolicyContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, apiId, policyId, parameters); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, policyId, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, policyId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, policyId, ifMatch, context); + } + + private ApiPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsClientImpl.java new file mode 100644 index 0000000000000..1d5d8825293de --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsClientImpl.java @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiProductsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.azure.resourcemanager.apimanagement.models.ProductCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiProductsClient. */ +public final class ApiProductsClientImpl implements ApiProductsClient { + private final ClientLogger logger = new ClientLogger(ApiProductsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiProductsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiProductsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiProductsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiProducts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiProductsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/products") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApis( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApisNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApisSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByApis( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApisSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByApis( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApisAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByApisSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByApisNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApisAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByApisSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByApisNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApisAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByApisSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByApisNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApis(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByApisAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApis( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listByApisAsync(resourceGroupName, serviceName, apiId, filter, top, skip, 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 paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApisNextSinglePageAsync(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.listByApisNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApisNextSinglePageAsync(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 + .listByApisNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsImpl.java new file mode 100644 index 0000000000000..7fcc89cfb368f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiProductsImpl.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.apimanagement.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.apimanagement.fluent.ApiProductsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiProducts; +import com.azure.resourcemanager.apimanagement.models.ProductContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiProductsImpl implements ApiProducts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiProductsImpl.class); + + private final ApiProductsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiProductsImpl( + ApiProductsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByApis(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByApis(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new ProductContractImpl(inner1, this.manager())); + } + + public PagedIterable listByApis( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByApis(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ProductContractImpl(inner1, this.manager())); + } + + private ApiProductsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleaseContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleaseContractImpl.java new file mode 100644 index 0000000000000..9d9f9ffc1b28f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleaseContractImpl.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.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiReleaseContract; +import java.time.OffsetDateTime; + +public final class ApiReleaseContractImpl + implements ApiReleaseContract, ApiReleaseContract.Definition, ApiReleaseContract.Update { + private ApiReleaseContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String apiId() { + return this.innerModel().apiId(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public OffsetDateTime updatedDateTime() { + return this.innerModel().updatedDateTime(); + } + + public String notes() { + return this.innerModel().notes(); + } + + public ApiReleaseContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String releaseId; + + private String createIfMatch; + + private String updateIfMatch; + + public ApiReleaseContractImpl withExistingApi(String resourceGroupName, String serviceName, String apiId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + return this; + } + + public ApiReleaseContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiReleases() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, releaseId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public ApiReleaseContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiReleases() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, releaseId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + ApiReleaseContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new ApiReleaseContractInner(); + this.serviceManager = serviceManager; + this.releaseId = name; + this.createIfMatch = null; + } + + public ApiReleaseContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public ApiReleaseContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiReleases() + .updateWithResponse( + resourceGroupName, serviceName, apiId, releaseId, updateIfMatch, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ApiReleaseContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiReleases() + .updateWithResponse( + resourceGroupName, serviceName, apiId, releaseId, updateIfMatch, this.innerModel(), context) + .getValue(); + return this; + } + + ApiReleaseContractImpl( + ApiReleaseContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.releaseId = Utils.getValueFromIdByName(innerObject.id(), "releases"); + } + + public ApiReleaseContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiReleases() + .getWithResponse(resourceGroupName, serviceName, apiId, releaseId, Context.NONE) + .getValue(); + return this; + } + + public ApiReleaseContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiReleases() + .getWithResponse(resourceGroupName, serviceName, apiId, releaseId, context) + .getValue(); + return this; + } + + public ApiReleaseContractImpl withApiId(String apiId) { + this.innerModel().withApiId(apiId); + return this; + } + + public ApiReleaseContractImpl withNotes(String notes) { + this.innerModel().withNotes(notes); + return this; + } + + public ApiReleaseContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesClientImpl.java new file mode 100644 index 0000000000000..71226bab6233b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesClientImpl.java @@ -0,0 +1,1577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiReleasesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiReleaseCollection; +import com.azure.resourcemanager.apimanagement.models.ApiReleasesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiReleasesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiReleasesGetResponse; +import com.azure.resourcemanager.apimanagement.models.ApiReleasesUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiReleasesClient. */ +public final class ApiReleasesClientImpl implements ApiReleasesClient { + private final ClientLogger logger = new ClientLogger(ApiReleasesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiReleasesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiReleasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiReleasesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiReleasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiReleases to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiReleasesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/releases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/releases/{releaseId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("releaseId") String releaseId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/releases/{releaseId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("releaseId") String releaseId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/releases/{releaseId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("releaseId") String releaseId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiReleaseContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/releases/{releaseId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("releaseId") String releaseId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiReleaseContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/releases/{releaseId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("releaseId") String releaseId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context)); + } + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String releaseId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagAsync(String resourceGroupName, String serviceName, String apiId, String releaseId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId) + .flatMap((ApiReleasesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String releaseId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, releaseId).block(); + } + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, context).block(); + } + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String releaseId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String releaseId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId) + .flatMap( + (ApiReleasesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiReleaseContractInner get(String resourceGroupName, String serviceName, String apiId, String releaseId) { + return getAsync(resourceGroupName, serviceName, apiId, releaseId).block(); + } + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, context).block(); + } + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch) + .flatMap( + (ApiReleasesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch) + .flatMap( + (ApiReleasesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiReleaseContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch).block(); + } + + /** + * Creates a new Release for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + ApiReleaseContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, releaseId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, ifMatch, parameters) + .flatMap( + (ApiReleasesUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiReleaseContractInner update( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner parameters) { + return updateAsync(resourceGroupName, serviceName, apiId, releaseId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the release of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Release Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String releaseId, + String ifMatch, + ApiReleaseContractInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String releaseId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String releaseId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (releaseId == null) { + return Mono.error(new IllegalArgumentException("Parameter releaseId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + releaseId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String releaseId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String releaseId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, releaseId, ifMatch).block(); + } + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, releaseId, ifMatch, 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 paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesImpl.java new file mode 100644 index 0000000000000..eb8789993b1de --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiReleasesImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiReleasesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiReleaseContract; +import com.azure.resourcemanager.apimanagement.models.ApiReleases; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiReleasesImpl implements ApiReleases { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleasesImpl.class); + + private final ApiReleasesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiReleasesImpl( + ApiReleasesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new ApiReleaseContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ApiReleaseContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, String releaseId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, releaseId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, apiId, releaseId, context); + } + + public ApiReleaseContract get(String resourceGroupName, String serviceName, String apiId, String releaseId) { + ApiReleaseContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, releaseId); + if (inner != null) { + return new ApiReleaseContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, releaseId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiReleaseContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiId, String releaseId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, releaseId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, String ifMatch, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, releaseId, ifMatch, context); + } + + public ApiReleaseContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String releaseId = Utils.getValueFromIdByName(id, "releases"); + if (releaseId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'releases'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, releaseId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String releaseId = Utils.getValueFromIdByName(id, "releases"); + if (releaseId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'releases'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, releaseId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String releaseId = Utils.getValueFromIdByName(id, "releases"); + if (releaseId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'releases'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, releaseId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String releaseId = Utils.getValueFromIdByName(id, "releases"); + if (releaseId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'releases'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, releaseId, ifMatch, context); + } + + private ApiReleasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public ApiReleaseContractImpl define(String name) { + return new ApiReleaseContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionContractImpl.java new file mode 100644 index 0000000000000..09dcf2dbb5f33 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiRevisionContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiRevisionContract; +import java.time.OffsetDateTime; + +public final class ApiRevisionContractImpl implements ApiRevisionContract { + private ApiRevisionContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ApiRevisionContractImpl( + ApiRevisionContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String apiId() { + return this.innerModel().apiId(); + } + + public String apiRevision() { + return this.innerModel().apiRevision(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public OffsetDateTime updatedDateTime() { + return this.innerModel().updatedDateTime(); + } + + public String description() { + return this.innerModel().description(); + } + + public String privateUrl() { + return this.innerModel().privateUrl(); + } + + public Boolean isOnline() { + return this.innerModel().isOnline(); + } + + public Boolean isCurrent() { + return this.innerModel().isCurrent(); + } + + public ApiRevisionContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsClientImpl.java new file mode 100644 index 0000000000000..af54ed484ea36 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsClientImpl.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiRevisionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiRevisionContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiRevisionCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiRevisionsClient. */ +public final class ApiRevisionsClientImpl implements ApiRevisionsClient { + private final ClientLogger logger = new ClientLogger(ApiRevisionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiRevisionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiRevisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiRevisionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiRevisionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiRevisions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiRevisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/revisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip, 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 paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsImpl.java new file mode 100644 index 0000000000000..ef20ab509fa6b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiRevisionsImpl.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.apimanagement.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.apimanagement.fluent.ApiRevisionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiRevisionContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiRevisionContract; +import com.azure.resourcemanager.apimanagement.models.ApiRevisions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiRevisionsImpl implements ApiRevisions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiRevisionsImpl.class); + + private final ApiRevisionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiRevisionsImpl( + ApiRevisionsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new ApiRevisionContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ApiRevisionContractImpl(inner1, this.manager())); + } + + private ApiRevisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasClientImpl.java new file mode 100644 index 0000000000000..3af4d508115b5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasClientImpl.java @@ -0,0 +1,1535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.apimanagement.fluent.ApiSchemasClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiSchemasGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiSchemasGetResponse; +import com.azure.resourcemanager.apimanagement.models.SchemaCollection; +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 ApiSchemasClient. */ +public final class ApiSchemasClientImpl implements ApiSchemasClient { + private final ClientLogger logger = new ClientLogger(ApiSchemasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiSchemasService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiSchemasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiSchemasClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiSchemasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiSchemas to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiSchemasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/schemas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("schemaId") String schemaId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("schemaId") String schemaId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("schemaId") String schemaId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SchemaContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("schemaId") String schemaId, + @QueryParam("force") Boolean force, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApiNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByApiNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the schema specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String schemaId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the schema specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the schema specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String apiId, String schemaId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId) + .flatMap((ApiSchemasGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String schemaId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, schemaId).block(); + } + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the schema specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId, context).block(); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String schemaId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String schemaId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId) + .flatMap( + (ApiSchemasGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemaContractInner get(String resourceGroupName, String serviceName, String apiId, String schemaId) { + return getAsync(resourceGroupName, serviceName, apiId, schemaId).block(); + } + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId, context).block(); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SchemaContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SchemaContractInner.class, + SchemaContractInner.class, + Context.NONE); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SchemaContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SchemaContractInner.class, SchemaContractInner.class, context); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SchemaContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch) + .getSyncPoller(); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SchemaContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, context) + .getSyncPoller(); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String apiId, String schemaId, SchemaContractInner parameters) { + final String ifMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemaContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch) { + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch).block(); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemaContractInner createOrUpdate( + String resourceGroupName, String serviceName, String apiId, String schemaId, SchemaContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch).block(); + } + + /** + * Creates or updates schema configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param parameters The schema contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemaContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + SchemaContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String schemaId, String ifMatch, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + force, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String schemaId, + String ifMatch, + Boolean force, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (schemaId == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + schemaId, + force, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String schemaId, String ifMatch, Boolean force) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String schemaId, String ifMatch) { + final Boolean force = null; + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String schemaId, String ifMatch) { + final Boolean force = null; + deleteAsync(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force).block(); + } + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + String ifMatch, + Boolean force, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list schema operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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.listByApiNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list schema operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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 + .listByApiNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasImpl.java new file mode 100644 index 0000000000000..566801cccfe6b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiSchemasImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiSchemasClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiSchemas; +import com.azure.resourcemanager.apimanagement.models.SchemaContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiSchemasImpl implements ApiSchemas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiSchemasImpl.class); + + private final ApiSchemasClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiSchemasImpl( + ApiSchemasClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new SchemaContractImpl(inner1, this.manager())); + } + + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new SchemaContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, String schemaId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, schemaId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, apiId, schemaId, context); + } + + public SchemaContract get(String resourceGroupName, String serviceName, String apiId, String schemaId) { + SchemaContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId, schemaId); + if (inner != null) { + return new SchemaContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, schemaId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SchemaContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiId, String schemaId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, schemaId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + String ifMatch, + Boolean force, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force, context); + } + + public SchemaContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String schemaId = Utils.getValueFromIdByName(id, "schemas"); + if (schemaId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, schemaId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String schemaId = Utils.getValueFromIdByName(id, "schemas"); + if (schemaId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, schemaId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String schemaId = Utils.getValueFromIdByName(id, "schemas"); + if (schemaId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); + } + String localIfMatch = null; + Boolean localForce = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, schemaId, localIfMatch, localForce, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Boolean force, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String schemaId = Utils.getValueFromIdByName(id, "schemas"); + if (schemaId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force, context); + } + + private ApiSchemasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public SchemaContractImpl define(String name) { + return new SchemaContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsClientImpl.java new file mode 100644 index 0000000000000..8785494ec2933 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsClientImpl.java @@ -0,0 +1,1389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiTagDescriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiTagDescriptionsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiTagDescriptionsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiTagDescriptionsGetResponse; +import com.azure.resourcemanager.apimanagement.models.TagDescriptionCollection; +import com.azure.resourcemanager.apimanagement.models.TagDescriptionCreateParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiTagDescriptionsClient. */ +public final class ApiTagDescriptionsClientImpl implements ApiTagDescriptionsClient { + private final ClientLogger logger = new ClientLogger(ApiTagDescriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiTagDescriptionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiTagDescriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiTagDescriptionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiTagDescriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiTagDescriptions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiTagDescriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tagDescriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagDescriptionId") String tagDescriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagDescriptionId") String tagDescriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagDescriptionId") String tagDescriptionId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagDescriptionCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagDescriptionId") String tagDescriptionId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context)); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, tagDescriptionId) + .flatMap((ApiTagDescriptionsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId, tagDescriptionId).block(); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, context).block(); + } + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, tagDescriptionId) + .flatMap( + (ApiTagDescriptionsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagDescriptionContractInner get( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + return getAsync(resourceGroupName, serviceName, apiId, tagDescriptionId).block(); + } + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, context).block(); + } + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, tagDescriptionId, parameters, ifMatch) + .flatMap( + (ApiTagDescriptionsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, tagDescriptionId, parameters, ifMatch) + .flatMap( + (ApiTagDescriptionsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagDescriptionContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, parameters, ifMatch) + .block(); + } + + /** + * Create/Update tag description in scope of the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + TagDescriptionCreateParameters parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiId, tagDescriptionId, parameters, ifMatch, context) + .block(); + } + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String tagDescriptionId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String tagDescriptionId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagDescriptionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter tagDescriptionId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String tagDescriptionId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String tagDescriptionId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch).block(); + } + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch, 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 paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsImpl.java new file mode 100644 index 0000000000000..25465bfe7add6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiTagDescriptionsImpl.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.apimanagement.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.apimanagement.fluent.ApiTagDescriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiTagDescriptions; +import com.azure.resourcemanager.apimanagement.models.TagDescriptionContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiTagDescriptionsImpl implements ApiTagDescriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiTagDescriptionsImpl.class); + + private final ApiTagDescriptionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiTagDescriptionsImpl( + ApiTagDescriptionsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new TagDescriptionContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new TagDescriptionContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId, tagDescriptionId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, context); + } + + public TagDescriptionContract get( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId) { + TagDescriptionContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, apiId, tagDescriptionId); + if (inner != null) { + return new TagDescriptionContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagDescriptionContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch, context); + } + + public TagDescriptionContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String tagDescriptionId = Utils.getValueFromIdByName(id, "tagDescriptions"); + if (tagDescriptionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'tagDescriptions'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String tagDescriptionId = Utils.getValueFromIdByName(id, "tagDescriptions"); + if (tagDescriptionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'tagDescriptions'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String tagDescriptionId = Utils.getValueFromIdByName(id, "tagDescriptions"); + if (tagDescriptionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'tagDescriptions'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String tagDescriptionId = Utils.getValueFromIdByName(id, "tagDescriptions"); + if (tagDescriptionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'tagDescriptions'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch, context); + } + + private ApiTagDescriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public TagDescriptionContractImpl define(String name) { + return new TagDescriptionContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetContractImpl.java new file mode 100644 index 0000000000000..88f9a2aa3657e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetContractImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetContract; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.VersioningScheme; + +public final class ApiVersionSetContractImpl + implements ApiVersionSetContract, ApiVersionSetContract.Definition, ApiVersionSetContract.Update { + private ApiVersionSetContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String versionQueryName() { + return this.innerModel().versionQueryName(); + } + + public String versionHeaderName() { + return this.innerModel().versionHeaderName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public VersioningScheme versioningScheme() { + return this.innerModel().versioningScheme(); + } + + public ApiVersionSetContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String versionSetId; + + private String createIfMatch; + + private String updateIfMatch; + + private ApiVersionSetUpdateParameters updateParameters; + + public ApiVersionSetContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ApiVersionSetContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiVersionSets() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, versionSetId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public ApiVersionSetContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiVersionSets() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, versionSetId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + ApiVersionSetContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new ApiVersionSetContractInner(); + this.serviceManager = serviceManager; + this.versionSetId = name; + this.createIfMatch = null; + } + + public ApiVersionSetContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new ApiVersionSetUpdateParameters(); + return this; + } + + public ApiVersionSetContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiVersionSets() + .updateWithResponse( + resourceGroupName, serviceName, versionSetId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ApiVersionSetContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiVersionSets() + .updateWithResponse( + resourceGroupName, serviceName, versionSetId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + ApiVersionSetContractImpl( + ApiVersionSetContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.versionSetId = Utils.getValueFromIdByName(innerObject.id(), "apiVersionSets"); + } + + public ApiVersionSetContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiVersionSets() + .getWithResponse(resourceGroupName, serviceName, versionSetId, Context.NONE) + .getValue(); + return this; + } + + public ApiVersionSetContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiVersionSets() + .getWithResponse(resourceGroupName, serviceName, versionSetId, context) + .getValue(); + return this; + } + + public ApiVersionSetContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public ApiVersionSetContractImpl withVersionQueryName(String versionQueryName) { + if (isInCreateMode()) { + this.innerModel().withVersionQueryName(versionQueryName); + return this; + } else { + this.updateParameters.withVersionQueryName(versionQueryName); + return this; + } + } + + public ApiVersionSetContractImpl withVersionHeaderName(String versionHeaderName) { + if (isInCreateMode()) { + this.innerModel().withVersionHeaderName(versionHeaderName); + return this; + } else { + this.updateParameters.withVersionHeaderName(versionHeaderName); + return this; + } + } + + public ApiVersionSetContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.innerModel().withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public ApiVersionSetContractImpl withVersioningScheme(VersioningScheme versioningScheme) { + if (isInCreateMode()) { + this.innerModel().withVersioningScheme(versioningScheme); + return this; + } else { + this.updateParameters.withVersioningScheme(versioningScheme); + return this; + } + } + + public ApiVersionSetContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsClientImpl.java new file mode 100644 index 0000000000000..7447ffbdaf54f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsClientImpl.java @@ -0,0 +1,1433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ApiVersionSetsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetCollection; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetsGetResponse; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetsUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ApiVersionSetsClient. */ +public final class ApiVersionSetsClientImpl implements ApiVersionSetsClient { + private final ClientLogger logger = new ClientLogger(ApiVersionSetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApiVersionSetsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApiVersionSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiVersionSetsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ApiVersionSetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApiVersionSets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApiVersionSetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apiVersionSets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apiVersionSets/{versionSetId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("versionSetId") String versionSetId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apiVersionSets/{versionSetId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("versionSetId") String versionSetId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apiVersionSets/{versionSetId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("versionSetId") String versionSetId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiVersionSetContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apiVersionSets/{versionSetId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("versionSetId") String versionSetId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiVersionSetUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apiVersionSets/{versionSetId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("versionSetId") String versionSetId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String versionSetId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String versionSetId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String versionSetId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, versionSetId) + .flatMap((ApiVersionSetsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String versionSetId) { + getEntityTagAsync(resourceGroupName, serviceName, versionSetId).block(); + } + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, versionSetId, context).block(); + } + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String versionSetId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String versionSetId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String versionSetId) { + return getWithResponseAsync(resourceGroupName, serviceName, versionSetId) + .flatMap( + (ApiVersionSetsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiVersionSetContractInner get(String resourceGroupName, String serviceName, String versionSetId) { + return getAsync(resourceGroupName, serviceName, versionSetId).block(); + } + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, versionSetId, context).block(); + } + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String versionSetId, + ApiVersionSetContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String versionSetId, + ApiVersionSetContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String versionSetId, + ApiVersionSetContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch) + .flatMap( + (ApiVersionSetsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String versionSetId, ApiVersionSetContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch) + .flatMap( + (ApiVersionSetsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiVersionSetContractInner createOrUpdate( + String resourceGroupName, String serviceName, String versionSetId, ApiVersionSetContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, versionSetId, parameters, ifMatch).block(); + } + + /** + * Creates or Updates a Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String versionSetId, + ApiVersionSetContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, versionSetId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, versionSetId, ifMatch, parameters) + .flatMap( + (ApiVersionSetsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiVersionSetContractInner update( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, versionSetId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the Api VersionSet specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api Version Set Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String versionSetId, + String ifMatch, + ApiVersionSetUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, versionSetId, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String versionSetId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String versionSetId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (versionSetId == null) { + return Mono.error(new IllegalArgumentException("Parameter versionSetId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + versionSetId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String versionSetId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, versionSetId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String versionSetId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, versionSetId, ifMatch).block(); + } + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String versionSetId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, versionSetId, ifMatch, 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 paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsImpl.java new file mode 100644 index 0000000000000..20734d55e1418 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApiVersionSetsImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApiVersionSetsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSetContract; +import com.azure.resourcemanager.apimanagement.models.ApiVersionSets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiVersionSetsImpl implements ApiVersionSets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetsImpl.class); + + private final ApiVersionSetsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApiVersionSetsImpl( + ApiVersionSetsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApiVersionSetContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ApiVersionSetContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String versionSetId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, versionSetId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, versionSetId, context); + } + + public ApiVersionSetContract get(String resourceGroupName, String serviceName, String versionSetId) { + ApiVersionSetContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, versionSetId); + if (inner != null) { + return new ApiVersionSetContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, versionSetId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiVersionSetContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String versionSetId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, versionSetId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String versionSetId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, versionSetId, ifMatch, context); + } + + public ApiVersionSetContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String versionSetId = Utils.getValueFromIdByName(id, "apiVersionSets"); + if (versionSetId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'apiVersionSets'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, versionSetId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String versionSetId = Utils.getValueFromIdByName(id, "apiVersionSets"); + if (versionSetId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'apiVersionSets'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, versionSetId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String versionSetId = Utils.getValueFromIdByName(id, "apiVersionSets"); + if (versionSetId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'apiVersionSets'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, versionSetId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String versionSetId = Utils.getValueFromIdByName(id, "apiVersionSets"); + if (versionSetId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'apiVersionSets'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, versionSetId, ifMatch, context); + } + + private ApiVersionSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public ApiVersionSetContractImpl define(String name) { + return new ApiVersionSetContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisClientImpl.java new file mode 100644 index 0000000000000..1e61726440e2c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisClientImpl.java @@ -0,0 +1,2132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.apimanagement.fluent.ApisClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiCollection; +import com.azure.resourcemanager.apimanagement.models.ApiCreateOrUpdateParameter; +import com.azure.resourcemanager.apimanagement.models.ApiUpdateContract; +import com.azure.resourcemanager.apimanagement.models.ApisGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ApisGetResponse; +import com.azure.resourcemanager.apimanagement.models.ApisUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.TagResourceCollection; +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 ApisClient. */ +public final class ApisClientImpl implements ApisClient { + private final ClientLogger logger = new ClientLogger(ApisClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApisService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ApisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApisClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(ApisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientApis to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface ApisService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("tags") String tags, + @QueryParam("expandApiVersionSet") Boolean expandApiVersionSet, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}") + @ExpectedResponses({200, 200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiCreateOrUpdateParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ApiUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("deleteRevisions") Boolean deleteRevisions, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apisByTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("includeNotTaggedApis") Boolean includeNotTaggedApis, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @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> listByTagsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + tags, + expandApiVersionSet, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + tags, + expandApiVersionSet, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String tags = null; + final Boolean expandApiVersionSet = null; + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String tags = null; + final Boolean expandApiVersionSet = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet)); + } + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet, context)); + } + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String apiId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId) + .flatMap((ApisGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String apiId) { + getEntityTagAsync(resourceGroupName, serviceName, apiId).block(); + } + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); + } + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = + "application/json, application/vnd.swagger.doc+json, application/vnd.oai.openapi+json," + + " application/vnd.sun.wadl+xml, application/wsdl+xml"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = + "application/json, application/vnd.swagger.doc+json, application/vnd.oai.openapi+json," + + " application/vnd.sun.wadl+xml, application/wsdl+xml"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String apiId) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId) + .flatMap( + (ApisGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner get(String resourceGroupName, String serviceName, String apiId) { + return getAsync(resourceGroupName, serviceName, apiId).block(); + } + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApiContractInner.class, ApiContractInner.class, Context.NONE); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApiContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApiContractInner.class, ApiContractInner.class, context); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch).getSyncPoller(); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApiContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, context) + .getSyncPoller(); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String apiId, ApiCreateOrUpdateParameter parameters) { + final String ifMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch) { + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch).block(); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner createOrUpdate( + String resourceGroupName, String serviceName, String apiId, ApiCreateOrUpdateParameter parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch).block(); + } + + /** + * Creates new or updates existing specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + ApiCreateOrUpdateParameter parameters, + String ifMatch, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, apiId, parameters, ifMatch, context).block(); + } + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String ifMatch, ApiUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + ApiUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, String apiId, String ifMatch, ApiUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, ifMatch, parameters) + .flatMap( + (ApisUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner update( + String resourceGroupName, String serviceName, String apiId, String ifMatch, ApiUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, apiId, ifMatch, parameters).block(); + } + + /** + * Updates the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters API Update Contract parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + ApiUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, apiId, ifMatch, parameters, context).block(); + } + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String ifMatch, Boolean deleteRevisions) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + deleteRevisions, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String apiId, + String ifMatch, + Boolean deleteRevisions, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + deleteRevisions, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String ifMatch, Boolean deleteRevisions) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, ifMatch, deleteRevisions) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiId, String ifMatch) { + final Boolean deleteRevisions = null; + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, ifMatch, deleteRevisions) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiId, String ifMatch) { + final Boolean deleteRevisions = null; + deleteAsync(resourceGroupName, serviceName, apiId, ifMatch, deleteRevisions).block(); + } + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + Boolean deleteRevisions, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, apiId, ifMatch, deleteRevisions, context) + .block(); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTags( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + includeNotTaggedApis, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTags( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + includeNotTaggedApis, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis) { + return new PagedFlux<>( + () -> listByTagsSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis), + nextLink -> listByTagsNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean includeNotTaggedApis = null; + return new PagedFlux<>( + () -> listByTagsSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis), + nextLink -> listByTagsNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis, + Context context) { + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis, context), + nextLink -> listByTagsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTags(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean includeNotTaggedApis = null; + return new PagedIterable<>( + listByTagsAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis)); + } + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis, + Context context) { + return new PagedIterable<>( + listByTagsAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis, 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 paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsNextSinglePageAsync(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.listByTagsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsNextSinglePageAsync( + 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 + .listByTagsNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisImpl.java new file mode 100644 index 0000000000000..558b08cbd4f4b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ApisImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ApisClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiContract; +import com.azure.resourcemanager.apimanagement.models.Apis; +import com.azure.resourcemanager.apimanagement.models.TagResourceContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApisImpl implements Apis { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApisImpl.class); + + private final ApisClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ApisImpl( + ApisClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApiContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet, context); + return Utils.mapPage(inner, inner1 -> new ApiContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String apiId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, apiId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, apiId, context); + } + + public ApiContract get(String resourceGroupName, String serviceName, String apiId) { + ApiContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiId); + if (inner != null) { + return new ApiContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, apiId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + Boolean deleteRevisions, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, apiId, ifMatch, deleteRevisions, context); + } + + public PagedIterable listByTags(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByTags(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + public PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByTags(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis, context); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + public ApiContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + String localIfMatch = null; + Boolean localDeleteRevisions = null; + this + .deleteWithResponse(resourceGroupName, serviceName, apiId, localIfMatch, localDeleteRevisions, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Boolean deleteRevisions, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String apiId = Utils.getValueFromIdByName(id, "apis"); + if (apiId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apis'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, apiId, ifMatch, deleteRevisions, context); + } + + private ApisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public ApiContractImpl define(String name) { + return new ApiContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerContractImpl.java new file mode 100644 index 0000000000000..19441babdd694 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerContractImpl.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; +import com.azure.resourcemanager.apimanagement.models.AuthorizationMethod; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerContract; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerSecretsContract; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerUpdateContract; +import com.azure.resourcemanager.apimanagement.models.BearerTokenSendingMethod; +import com.azure.resourcemanager.apimanagement.models.ClientAuthenticationMethod; +import com.azure.resourcemanager.apimanagement.models.GrantType; +import com.azure.resourcemanager.apimanagement.models.TokenBodyParameterContract; +import java.util.Collections; +import java.util.List; + +public final class AuthorizationServerContractImpl + implements AuthorizationServerContract, AuthorizationServerContract.Definition, AuthorizationServerContract.Update { + private AuthorizationServerContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public List authorizationMethods() { + List inner = this.innerModel().authorizationMethods(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List clientAuthenticationMethod() { + List inner = this.innerModel().clientAuthenticationMethod(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List tokenBodyParameters() { + List inner = this.innerModel().tokenBodyParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String tokenEndpoint() { + return this.innerModel().tokenEndpoint(); + } + + public Boolean supportState() { + return this.innerModel().supportState(); + } + + public String defaultScope() { + return this.innerModel().defaultScope(); + } + + public List bearerTokenSendingMethods() { + List inner = this.innerModel().bearerTokenSendingMethods(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceOwnerUsername() { + return this.innerModel().resourceOwnerUsername(); + } + + public String resourceOwnerPassword() { + return this.innerModel().resourceOwnerPassword(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String clientRegistrationEndpoint() { + return this.innerModel().clientRegistrationEndpoint(); + } + + public String authorizationEndpoint() { + return this.innerModel().authorizationEndpoint(); + } + + public List grantTypes() { + List inner = this.innerModel().grantTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String clientId() { + return this.innerModel().clientId(); + } + + public String clientSecret() { + return this.innerModel().clientSecret(); + } + + public AuthorizationServerContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String authsid; + + private String createIfMatch; + + private String updateIfMatch; + + private AuthorizationServerUpdateContract updateParameters; + + public AuthorizationServerContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public AuthorizationServerContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizationServers() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, authsid, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public AuthorizationServerContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizationServers() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, authsid, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + AuthorizationServerContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new AuthorizationServerContractInner(); + this.serviceManager = serviceManager; + this.authsid = name; + this.createIfMatch = null; + } + + public AuthorizationServerContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new AuthorizationServerUpdateContract(); + return this; + } + + public AuthorizationServerContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizationServers() + .updateWithResponse( + resourceGroupName, serviceName, authsid, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public AuthorizationServerContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizationServers() + .updateWithResponse(resourceGroupName, serviceName, authsid, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + AuthorizationServerContractImpl( + AuthorizationServerContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.authsid = Utils.getValueFromIdByName(innerObject.id(), "authorizationServers"); + } + + public AuthorizationServerContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizationServers() + .getWithResponse(resourceGroupName, serviceName, authsid, Context.NONE) + .getValue(); + return this; + } + + public AuthorizationServerContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizationServers() + .getWithResponse(resourceGroupName, serviceName, authsid, context) + .getValue(); + return this; + } + + public AuthorizationServerSecretsContract listSecrets() { + return serviceManager.authorizationServers().listSecrets(resourceGroupName, serviceName, authsid); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager + .authorizationServers() + .listSecretsWithResponse(resourceGroupName, serviceName, authsid, context); + } + + public AuthorizationServerContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public AuthorizationServerContractImpl withAuthorizationMethods(List authorizationMethods) { + if (isInCreateMode()) { + this.innerModel().withAuthorizationMethods(authorizationMethods); + return this; + } else { + this.updateParameters.withAuthorizationMethods(authorizationMethods); + return this; + } + } + + public AuthorizationServerContractImpl withClientAuthenticationMethod( + List clientAuthenticationMethod) { + if (isInCreateMode()) { + this.innerModel().withClientAuthenticationMethod(clientAuthenticationMethod); + return this; + } else { + this.updateParameters.withClientAuthenticationMethod(clientAuthenticationMethod); + return this; + } + } + + public AuthorizationServerContractImpl withTokenBodyParameters( + List tokenBodyParameters) { + if (isInCreateMode()) { + this.innerModel().withTokenBodyParameters(tokenBodyParameters); + return this; + } else { + this.updateParameters.withTokenBodyParameters(tokenBodyParameters); + return this; + } + } + + public AuthorizationServerContractImpl withTokenEndpoint(String tokenEndpoint) { + if (isInCreateMode()) { + this.innerModel().withTokenEndpoint(tokenEndpoint); + return this; + } else { + this.updateParameters.withTokenEndpoint(tokenEndpoint); + return this; + } + } + + public AuthorizationServerContractImpl withSupportState(Boolean supportState) { + if (isInCreateMode()) { + this.innerModel().withSupportState(supportState); + return this; + } else { + this.updateParameters.withSupportState(supportState); + return this; + } + } + + public AuthorizationServerContractImpl withDefaultScope(String defaultScope) { + if (isInCreateMode()) { + this.innerModel().withDefaultScope(defaultScope); + return this; + } else { + this.updateParameters.withDefaultScope(defaultScope); + return this; + } + } + + public AuthorizationServerContractImpl withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + if (isInCreateMode()) { + this.innerModel().withBearerTokenSendingMethods(bearerTokenSendingMethods); + return this; + } else { + this.updateParameters.withBearerTokenSendingMethods(bearerTokenSendingMethods); + return this; + } + } + + public AuthorizationServerContractImpl withResourceOwnerUsername(String resourceOwnerUsername) { + if (isInCreateMode()) { + this.innerModel().withResourceOwnerUsername(resourceOwnerUsername); + return this; + } else { + this.updateParameters.withResourceOwnerUsername(resourceOwnerUsername); + return this; + } + } + + public AuthorizationServerContractImpl withResourceOwnerPassword(String resourceOwnerPassword) { + if (isInCreateMode()) { + this.innerModel().withResourceOwnerPassword(resourceOwnerPassword); + return this; + } else { + this.updateParameters.withResourceOwnerPassword(resourceOwnerPassword); + return this; + } + } + + public AuthorizationServerContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.innerModel().withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public AuthorizationServerContractImpl withClientRegistrationEndpoint(String clientRegistrationEndpoint) { + if (isInCreateMode()) { + this.innerModel().withClientRegistrationEndpoint(clientRegistrationEndpoint); + return this; + } else { + this.updateParameters.withClientRegistrationEndpoint(clientRegistrationEndpoint); + return this; + } + } + + public AuthorizationServerContractImpl withAuthorizationEndpoint(String authorizationEndpoint) { + if (isInCreateMode()) { + this.innerModel().withAuthorizationEndpoint(authorizationEndpoint); + return this; + } else { + this.updateParameters.withAuthorizationEndpoint(authorizationEndpoint); + return this; + } + } + + public AuthorizationServerContractImpl withGrantTypes(List grantTypes) { + if (isInCreateMode()) { + this.innerModel().withGrantTypes(grantTypes); + return this; + } else { + this.updateParameters.withGrantTypes(grantTypes); + return this; + } + } + + public AuthorizationServerContractImpl withClientId(String clientId) { + if (isInCreateMode()) { + this.innerModel().withClientId(clientId); + return this; + } else { + this.updateParameters.withClientId(clientId); + return this; + } + } + + public AuthorizationServerContractImpl withClientSecret(String clientSecret) { + if (isInCreateMode()) { + this.innerModel().withClientSecret(clientSecret); + return this; + } else { + this.updateParameters.withClientSecret(clientSecret); + return this; + } + } + + public AuthorizationServerContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerSecretsContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerSecretsContractImpl.java new file mode 100644 index 0000000000000..461afc7698f1f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServerSecretsContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerSecretsContract; + +public final class AuthorizationServerSecretsContractImpl implements AuthorizationServerSecretsContract { + private AuthorizationServerSecretsContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + AuthorizationServerSecretsContractImpl( + AuthorizationServerSecretsContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String clientSecret() { + return this.innerModel().clientSecret(); + } + + public String resourceOwnerUsername() { + return this.innerModel().resourceOwnerUsername(); + } + + public String resourceOwnerPassword() { + return this.innerModel().resourceOwnerPassword(); + } + + public AuthorizationServerSecretsContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersClientImpl.java new file mode 100644 index 0000000000000..b70a8d4102ee1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersClientImpl.java @@ -0,0 +1,1626 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.AuthorizationServersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerCollection; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerUpdateContract; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServersCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServersGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServersGetResponse; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServersListSecretsResponse; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServersUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AuthorizationServersClient. */ +public final class AuthorizationServersClientImpl implements AuthorizationServersClient { + private final ClientLogger logger = new ClientLogger(AuthorizationServersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AuthorizationServersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of AuthorizationServersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AuthorizationServersClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(AuthorizationServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientAuthorizationServers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientA") + private interface AuthorizationServersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers/{authsid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("authsid") String authsid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers/{authsid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("authsid") String authsid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers/{authsid}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("authsid") String authsid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AuthorizationServerContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers/{authsid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("authsid") String authsid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AuthorizationServerUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers/{authsid}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("authsid") String authsid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/authorizationServers/{authsid}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listSecrets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("authsid") String authsid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the authorizationServer specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String authsid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the authorizationServer specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String authsid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the authorizationServer specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String authsid) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, authsid) + .flatMap((AuthorizationServersGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String authsid) { + getEntityTagAsync(resourceGroupName, serviceName, authsid).block(); + } + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the authorizationServer specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, authsid, context).block(); + } + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String authsid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String authsid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String authsid) { + return getWithResponseAsync(resourceGroupName, serviceName, authsid) + .flatMap( + (AuthorizationServersGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationServerContractInner get(String resourceGroupName, String serviceName, String authsid) { + return getAsync(resourceGroupName, serviceName, authsid).block(); + } + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, authsid, context).block(); + } + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String authsid, + AuthorizationServerContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String authsid, + AuthorizationServerContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String authsid, + AuthorizationServerContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch) + .flatMap( + (AuthorizationServersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String authsid, AuthorizationServerContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch) + .flatMap( + (AuthorizationServersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationServerContractInner createOrUpdate( + String resourceGroupName, String serviceName, String authsid, AuthorizationServerContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch).block(); + } + + /** + * Creates new authorization server or updates an existing authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String authsid, + AuthorizationServerContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, authsid, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, authsid, ifMatch, parameters) + .flatMap( + (AuthorizationServersUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationServerContractInner update( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, authsid, ifMatch, parameters).block(); + } + + /** + * Updates the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters OAuth2 Server settings Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return external OAuth authorization server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String authsid, + String ifMatch, + AuthorizationServerUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, authsid, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String authsid, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String authsid, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String authsid, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, authsid, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String authsid, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, authsid, ifMatch).block(); + } + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String authsid, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, authsid, ifMatch, context).block(); + } + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String authsid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String authsid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (authsid == null) { + return Mono.error(new IllegalArgumentException("Parameter authsid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + authsid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String serviceName, String authsid) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, authsid) + .flatMap( + (AuthorizationServersListSecretsResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthorizationServerSecretsContractInner listSecrets( + String resourceGroupName, String serviceName, String authsid) { + return listSecretsAsync(resourceGroupName, serviceName, authsid).block(); + } + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, authsid, 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 paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersImpl.java new file mode 100644 index 0000000000000..ddec467f9389c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/AuthorizationServersImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.AuthorizationServersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerContract; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServerSecretsContract; +import com.azure.resourcemanager.apimanagement.models.AuthorizationServers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AuthorizationServersImpl implements AuthorizationServers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServersImpl.class); + + private final AuthorizationServersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public AuthorizationServersImpl( + AuthorizationServersClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new AuthorizationServerContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new AuthorizationServerContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String authsid) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, authsid); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, authsid, context); + } + + public AuthorizationServerContract get(String resourceGroupName, String serviceName, String authsid) { + AuthorizationServerContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, authsid); + if (inner != null) { + return new AuthorizationServerContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, authsid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthorizationServerContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String authsid, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, authsid, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String authsid, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, authsid, ifMatch, context); + } + + public AuthorizationServerSecretsContract listSecrets( + String resourceGroupName, String serviceName, String authsid) { + AuthorizationServerSecretsContractInner inner = + this.serviceClient().listSecrets(resourceGroupName, serviceName, authsid); + if (inner != null) { + return new AuthorizationServerSecretsContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, serviceName, authsid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthorizationServerSecretsContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AuthorizationServerContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String authsid = Utils.getValueFromIdByName(id, "authorizationServers"); + if (authsid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'authorizationServers'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, authsid, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String authsid = Utils.getValueFromIdByName(id, "authorizationServers"); + if (authsid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'authorizationServers'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, authsid, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String authsid = Utils.getValueFromIdByName(id, "authorizationServers"); + if (authsid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'authorizationServers'.", + id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, authsid, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String authsid = Utils.getValueFromIdByName(id, "authorizationServers"); + if (authsid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'authorizationServers'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, authsid, ifMatch, context); + } + + private AuthorizationServersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public AuthorizationServerContractImpl define(String name) { + return new AuthorizationServerContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendContractImpl.java new file mode 100644 index 0000000000000..d592346961a4e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendContractImpl.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; +import com.azure.resourcemanager.apimanagement.models.BackendContract; +import com.azure.resourcemanager.apimanagement.models.BackendCredentialsContract; +import com.azure.resourcemanager.apimanagement.models.BackendProperties; +import com.azure.resourcemanager.apimanagement.models.BackendProtocol; +import com.azure.resourcemanager.apimanagement.models.BackendProxyContract; +import com.azure.resourcemanager.apimanagement.models.BackendReconnectContract; +import com.azure.resourcemanager.apimanagement.models.BackendTlsProperties; +import com.azure.resourcemanager.apimanagement.models.BackendUpdateParameters; + +public final class BackendContractImpl implements BackendContract, BackendContract.Definition, BackendContract.Update { + private BackendContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public BackendProperties properties() { + return this.innerModel().properties(); + } + + public BackendCredentialsContract credentials() { + return this.innerModel().credentials(); + } + + public BackendProxyContract proxy() { + return this.innerModel().proxy(); + } + + public BackendTlsProperties tls() { + return this.innerModel().tls(); + } + + public String url() { + return this.innerModel().url(); + } + + public BackendProtocol protocol() { + return this.innerModel().protocol(); + } + + public BackendContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String backendId; + + private String createIfMatch; + + private String updateIfMatch; + + private BackendUpdateParameters updateParameters; + + public BackendContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public BackendContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getBackends() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, backendId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public BackendContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackends() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, backendId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + BackendContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new BackendContractInner(); + this.serviceManager = serviceManager; + this.backendId = name; + this.createIfMatch = null; + } + + public BackendContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new BackendUpdateParameters(); + return this; + } + + public BackendContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBackends() + .updateWithResponse( + resourceGroupName, serviceName, backendId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public BackendContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackends() + .updateWithResponse(resourceGroupName, serviceName, backendId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + BackendContractImpl( + BackendContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.backendId = Utils.getValueFromIdByName(innerObject.id(), "backends"); + } + + public BackendContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBackends() + .getWithResponse(resourceGroupName, serviceName, backendId, Context.NONE) + .getValue(); + return this; + } + + public BackendContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBackends() + .getWithResponse(resourceGroupName, serviceName, backendId, context) + .getValue(); + return this; + } + + public void reconnect() { + serviceManager.backends().reconnect(resourceGroupName, serviceName, backendId); + } + + public Response reconnectWithResponse(BackendReconnectContract parameters, Context context) { + return serviceManager + .backends() + .reconnectWithResponse(resourceGroupName, serviceName, backendId, parameters, context); + } + + public BackendContractImpl withTitle(String title) { + if (isInCreateMode()) { + this.innerModel().withTitle(title); + return this; + } else { + this.updateParameters.withTitle(title); + return this; + } + } + + public BackendContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public BackendContractImpl withResourceId(String resourceId) { + if (isInCreateMode()) { + this.innerModel().withResourceId(resourceId); + return this; + } else { + this.updateParameters.withResourceId(resourceId); + return this; + } + } + + public BackendContractImpl withProperties(BackendProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } + } + + public BackendContractImpl withCredentials(BackendCredentialsContract credentials) { + if (isInCreateMode()) { + this.innerModel().withCredentials(credentials); + return this; + } else { + this.updateParameters.withCredentials(credentials); + return this; + } + } + + public BackendContractImpl withProxy(BackendProxyContract proxy) { + if (isInCreateMode()) { + this.innerModel().withProxy(proxy); + return this; + } else { + this.updateParameters.withProxy(proxy); + return this; + } + } + + public BackendContractImpl withTls(BackendTlsProperties tls) { + if (isInCreateMode()) { + this.innerModel().withTls(tls); + return this; + } else { + this.updateParameters.withTls(tls); + return this; + } + } + + public BackendContractImpl withUrl(String url) { + if (isInCreateMode()) { + this.innerModel().withUrl(url); + return this; + } else { + this.updateParameters.withUrl(url); + return this; + } + } + + public BackendContractImpl withProtocol(BackendProtocol protocol) { + if (isInCreateMode()) { + this.innerModel().withProtocol(protocol); + return this; + } else { + this.updateParameters.withProtocol(protocol); + return this; + } + } + + public BackendContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsClientImpl.java new file mode 100644 index 0000000000000..8d364913651b2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsClientImpl.java @@ -0,0 +1,1663 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.BackendsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; +import com.azure.resourcemanager.apimanagement.models.BackendCollection; +import com.azure.resourcemanager.apimanagement.models.BackendReconnectContract; +import com.azure.resourcemanager.apimanagement.models.BackendUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.BackendsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.BackendsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.BackendsGetResponse; +import com.azure.resourcemanager.apimanagement.models.BackendsUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BackendsClient. */ +public final class BackendsClientImpl implements BackendsClient { + private final ClientLogger logger = new ClientLogger(BackendsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BackendsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of BackendsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackendsClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(BackendsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientBackends to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientB") + private interface BackendsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends/{backendId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("backendId") String backendId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends/{backendId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("backendId") String backendId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends/{backendId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("backendId") String backendId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackendContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends/{backendId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("backendId") String backendId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackendUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends/{backendId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("backendId") String backendId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/backends/{backendId}/reconnect") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> reconnect( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("backendId") String backendId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BackendReconnectContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String backendId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String backendId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String backendId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, backendId) + .flatMap((BackendsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String backendId) { + getEntityTagAsync(resourceGroupName, serviceName, backendId).block(); + } + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, backendId, context).block(); + } + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String backendId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String backendId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String backendId) { + return getWithResponseAsync(resourceGroupName, serviceName, backendId) + .flatMap( + (BackendsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendContractInner get(String resourceGroupName, String serviceName, String backendId) { + return getAsync(resourceGroupName, serviceName, backendId).block(); + } + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, backendId, context).block(); + } + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String backendId, + BackendContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String backendId, + BackendContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String backendId, + BackendContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, backendId, parameters, ifMatch) + .flatMap( + (BackendsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String backendId, BackendContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, backendId, parameters, ifMatch) + .flatMap( + (BackendsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendContractInner createOrUpdate( + String resourceGroupName, String serviceName, String backendId, BackendContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, backendId, parameters, ifMatch).block(); + } + + /** + * Creates or Updates a backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + BackendContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, backendId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, backendId, ifMatch, parameters) + .flatMap( + (BackendsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendContractInner update( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, backendId, ifMatch, parameters).block(); + } + + /** + * Updates an existing backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return backend details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + String ifMatch, + BackendUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, backendId, ifMatch, parameters, context).block(); + } + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String backendId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String backendId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String backendId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, backendId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String backendId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, backendId, ifMatch).block(); + } + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String backendId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, backendId, ifMatch, context).block(); + } + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Reconnect request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> reconnectWithResponseAsync( + String resourceGroupName, String serviceName, String backendId, BackendReconnectContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and 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) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reconnect( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Reconnect request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> reconnectWithResponseAsync( + String resourceGroupName, + String serviceName, + String backendId, + BackendReconnectContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (backendId == null) { + return Mono.error(new IllegalArgumentException("Parameter backendId is required and 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) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reconnect( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + backendId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Reconnect request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 reconnectAsync( + String resourceGroupName, String serviceName, String backendId, BackendReconnectContract parameters) { + return reconnectWithResponseAsync(resourceGroupName, serviceName, backendId, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 reconnectAsync(String resourceGroupName, String serviceName, String backendId) { + final BackendReconnectContract parameters = null; + return reconnectWithResponseAsync(resourceGroupName, serviceName, backendId, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reconnect(String resourceGroupName, String serviceName, String backendId) { + final BackendReconnectContract parameters = null; + reconnectAsync(resourceGroupName, serviceName, backendId, parameters).block(); + } + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Reconnect request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response reconnectWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + BackendReconnectContract parameters, + Context context) { + return reconnectWithResponseAsync(resourceGroupName, serviceName, backendId, parameters, 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 paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsImpl.java new file mode 100644 index 0000000000000..653a9a82cd39f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/BackendsImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.BackendsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; +import com.azure.resourcemanager.apimanagement.models.BackendContract; +import com.azure.resourcemanager.apimanagement.models.BackendReconnectContract; +import com.azure.resourcemanager.apimanagement.models.Backends; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BackendsImpl implements Backends { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendsImpl.class); + + private final BackendsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public BackendsImpl( + BackendsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new BackendContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new BackendContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String backendId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, backendId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, backendId, context); + } + + public BackendContract get(String resourceGroupName, String serviceName, String backendId) { + BackendContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, backendId); + if (inner != null) { + return new BackendContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, backendId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BackendContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String backendId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, backendId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String backendId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, backendId, ifMatch, context); + } + + public void reconnect(String resourceGroupName, String serviceName, String backendId) { + this.serviceClient().reconnect(resourceGroupName, serviceName, backendId); + } + + public Response reconnectWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + BackendReconnectContract parameters, + Context context) { + return this + .serviceClient() + .reconnectWithResponse(resourceGroupName, serviceName, backendId, parameters, context); + } + + public BackendContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String backendId = Utils.getValueFromIdByName(id, "backends"); + if (backendId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backends'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, backendId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String backendId = Utils.getValueFromIdByName(id, "backends"); + if (backendId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backends'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, backendId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String backendId = Utils.getValueFromIdByName(id, "backends"); + if (backendId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backends'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, backendId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String backendId = Utils.getValueFromIdByName(id, "backends"); + if (backendId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'backends'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, backendId, ifMatch, context); + } + + private BackendsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public BackendContractImpl define(String name) { + return new BackendContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CacheContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CacheContractImpl.java new file mode 100644 index 0000000000000..f6cb60378a45a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CacheContractImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; +import com.azure.resourcemanager.apimanagement.models.CacheContract; +import com.azure.resourcemanager.apimanagement.models.CacheUpdateParameters; + +public final class CacheContractImpl implements CacheContract, CacheContract.Definition, CacheContract.Update { + private CacheContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String connectionString() { + return this.innerModel().connectionString(); + } + + public String useFromLocation() { + return this.innerModel().useFromLocation(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public CacheContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String cacheId; + + private String createIfMatch; + + private String updateIfMatch; + + private CacheUpdateParameters updateParameters; + + public CacheContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public CacheContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getCaches() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, cacheId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public CacheContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCaches() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, cacheId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + CacheContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new CacheContractInner(); + this.serviceManager = serviceManager; + this.cacheId = name; + this.createIfMatch = null; + } + + public CacheContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new CacheUpdateParameters(); + return this; + } + + public CacheContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCaches() + .updateWithResponse( + resourceGroupName, serviceName, cacheId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public CacheContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCaches() + .updateWithResponse(resourceGroupName, serviceName, cacheId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + CacheContractImpl( + CacheContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.cacheId = Utils.getValueFromIdByName(innerObject.id(), "caches"); + } + + public CacheContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCaches() + .getWithResponse(resourceGroupName, serviceName, cacheId, Context.NONE) + .getValue(); + return this; + } + + public CacheContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCaches() + .getWithResponse(resourceGroupName, serviceName, cacheId, context) + .getValue(); + return this; + } + + public CacheContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public CacheContractImpl withConnectionString(String connectionString) { + if (isInCreateMode()) { + this.innerModel().withConnectionString(connectionString); + return this; + } else { + this.updateParameters.withConnectionString(connectionString); + return this; + } + } + + public CacheContractImpl withUseFromLocation(String useFromLocation) { + if (isInCreateMode()) { + this.innerModel().withUseFromLocation(useFromLocation); + return this; + } else { + this.updateParameters.withUseFromLocation(useFromLocation); + return this; + } + } + + public CacheContractImpl withResourceId(String resourceId) { + if (isInCreateMode()) { + this.innerModel().withResourceId(resourceId); + return this; + } else { + this.updateParameters.withResourceId(resourceId); + return this; + } + } + + public CacheContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesClientImpl.java new file mode 100644 index 0000000000000..1d15985ee9324 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesClientImpl.java @@ -0,0 +1,1430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.CachesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; +import com.azure.resourcemanager.apimanagement.models.CacheCollection; +import com.azure.resourcemanager.apimanagement.models.CacheUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.CachesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.CachesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.CachesGetResponse; +import com.azure.resourcemanager.apimanagement.models.CachesUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CachesClient. */ +public final class CachesClientImpl implements CachesClient { + private final ClientLogger logger = new ClientLogger(CachesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CachesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of CachesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CachesClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(CachesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientCaches to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientC") + private interface CachesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/caches") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/caches/{cacheId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("cacheId") String cacheId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/caches/{cacheId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("cacheId") String cacheId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/caches/{cacheId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("cacheId") String cacheId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CacheContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/caches/{cacheId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("cacheId") String cacheId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CacheUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/caches/{cacheId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("cacheId") String cacheId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, top, skip)); + } + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String cacheId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String cacheId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String cacheId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, cacheId) + .flatMap((CachesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String cacheId) { + getEntityTagAsync(resourceGroupName, serviceName, cacheId).block(); + } + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, cacheId, context).block(); + } + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, String cacheId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String cacheId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String cacheId) { + return getWithResponseAsync(resourceGroupName, serviceName, cacheId) + .flatMap( + (CachesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheContractInner get(String resourceGroupName, String serviceName, String cacheId) { + return getAsync(resourceGroupName, serviceName, cacheId).block(); + } + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, cacheId, context).block(); + } + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String cacheId, CacheContractInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String cacheId, + CacheContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String cacheId, CacheContractInner parameters, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, cacheId, parameters, ifMatch) + .flatMap( + (CachesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String cacheId, CacheContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, cacheId, parameters, ifMatch) + .flatMap( + (CachesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheContractInner createOrUpdate( + String resourceGroupName, String serviceName, String cacheId, CacheContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, cacheId, parameters, ifMatch).block(); + } + + /** + * Creates or updates an External Cache to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String cacheId, + CacheContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, cacheId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String cacheId, + String ifMatch, + CacheUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String cacheId, + String ifMatch, + CacheUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String cacheId, + String ifMatch, + CacheUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, cacheId, ifMatch, parameters) + .flatMap( + (CachesUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CacheContractInner update( + String resourceGroupName, + String serviceName, + String cacheId, + String ifMatch, + CacheUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, cacheId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cache details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String cacheId, + String ifMatch, + CacheUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, cacheId, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String cacheId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String cacheId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (cacheId == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + cacheId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String cacheId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, cacheId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String cacheId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, cacheId, ifMatch).block(); + } + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String cacheId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, cacheId, ifMatch, 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 paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesImpl.java new file mode 100644 index 0000000000000..6a3cef76ce131 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CachesImpl.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.apimanagement.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.apimanagement.fluent.CachesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; +import com.azure.resourcemanager.apimanagement.models.CacheContract; +import com.azure.resourcemanager.apimanagement.models.Caches; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CachesImpl implements Caches { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CachesImpl.class); + + private final CachesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public CachesImpl( + CachesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new CacheContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, top, skip, context); + return Utils.mapPage(inner, inner1 -> new CacheContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String cacheId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, cacheId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, cacheId, context); + } + + public CacheContract get(String resourceGroupName, String serviceName, String cacheId) { + CacheContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, cacheId); + if (inner != null) { + return new CacheContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, cacheId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CacheContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String cacheId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, cacheId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String cacheId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, cacheId, ifMatch, context); + } + + public CacheContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String cacheId = Utils.getValueFromIdByName(id, "caches"); + if (cacheId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'caches'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, cacheId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String cacheId = Utils.getValueFromIdByName(id, "caches"); + if (cacheId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'caches'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, cacheId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String cacheId = Utils.getValueFromIdByName(id, "caches"); + if (cacheId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'caches'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, cacheId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String cacheId = Utils.getValueFromIdByName(id, "caches"); + if (cacheId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'caches'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, cacheId, ifMatch, context); + } + + private CachesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public CacheContractImpl define(String name) { + return new CacheContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificateContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificateContractImpl.java new file mode 100644 index 0000000000000..513663ea118e0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificateContractImpl.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; +import com.azure.resourcemanager.apimanagement.models.CertificateContract; +import com.azure.resourcemanager.apimanagement.models.CertificateCreateOrUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.KeyVaultContractCreateProperties; +import com.azure.resourcemanager.apimanagement.models.KeyVaultContractProperties; +import java.time.OffsetDateTime; + +public final class CertificateContractImpl + implements CertificateContract, CertificateContract.Definition, CertificateContract.Update { + private CertificateContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String subject() { + return this.innerModel().subject(); + } + + public String thumbprint() { + return this.innerModel().thumbprint(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public KeyVaultContractProperties keyVault() { + return this.innerModel().keyVault(); + } + + public CertificateContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String certificateId; + + private String createIfMatch; + + private CertificateCreateOrUpdateParameters createParameters; + + private String updateIfMatch; + + private CertificateCreateOrUpdateParameters updateParameters; + + public CertificateContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public CertificateContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, certificateId, createParameters, createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public CertificateContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, certificateId, createParameters, createIfMatch, context) + .getValue(); + return this; + } + + CertificateContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new CertificateContractInner(); + this.serviceManager = serviceManager; + this.certificateId = name; + this.createIfMatch = null; + this.createParameters = new CertificateCreateOrUpdateParameters(); + } + + public CertificateContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new CertificateCreateOrUpdateParameters(); + return this; + } + + public CertificateContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, certificateId, updateParameters, updateIfMatch, Context.NONE) + .getValue(); + return this; + } + + public CertificateContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, certificateId, updateParameters, updateIfMatch, context) + .getValue(); + return this; + } + + CertificateContractImpl( + CertificateContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.certificateId = Utils.getValueFromIdByName(innerObject.id(), "certificates"); + } + + public CertificateContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, serviceName, certificateId, Context.NONE) + .getValue(); + return this; + } + + public CertificateContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, serviceName, certificateId, context) + .getValue(); + return this; + } + + public CertificateContract refreshSecret() { + return serviceManager.certificates().refreshSecret(resourceGroupName, serviceName, certificateId); + } + + public Response refreshSecretWithResponse(Context context) { + return serviceManager + .certificates() + .refreshSecretWithResponse(resourceGroupName, serviceName, certificateId, context); + } + + public CertificateContractImpl withData(String data) { + if (isInCreateMode()) { + this.createParameters.withData(data); + return this; + } else { + this.updateParameters.withData(data); + return this; + } + } + + public CertificateContractImpl withPassword(String password) { + if (isInCreateMode()) { + this.createParameters.withPassword(password); + return this; + } else { + this.updateParameters.withPassword(password); + return this; + } + } + + public CertificateContractImpl withKeyVault(KeyVaultContractCreateProperties keyVault) { + if (isInCreateMode()) { + this.createParameters.withKeyVault(keyVault); + return this; + } else { + this.updateParameters.withKeyVault(keyVault); + return this; + } + } + + public CertificateContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesClientImpl.java new file mode 100644 index 0000000000000..8178276c8ef06 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesClientImpl.java @@ -0,0 +1,1475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.CertificatesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; +import com.azure.resourcemanager.apimanagement.models.CertificateCollection; +import com.azure.resourcemanager.apimanagement.models.CertificateCreateOrUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.CertificatesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.CertificatesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.CertificatesGetResponse; +import com.azure.resourcemanager.apimanagement.models.CertificatesRefreshSecretResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public final class CertificatesClientImpl implements CertificatesClient { + private final ClientLogger logger = new ClientLogger(CertificatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CertificatesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of CertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CertificatesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientCertificates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientC") + private interface CertificatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/certificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("isKeyVaultRefreshFailed") Boolean isKeyVaultRefreshFailed, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/certificates/{certificateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateId") String certificateId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/certificates/{certificateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateId") String certificateId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/certificates/{certificateId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateId") String certificateId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CertificateCreateOrUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/certificates/{certificateId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateId") String certificateId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/certificates/{certificateId}/refreshSecret") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono refreshSecret( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateId") String certificateId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + isKeyVaultRefreshFailed, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + isKeyVaultRefreshFailed, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean isKeyVaultRefreshFailed = null; + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean isKeyVaultRefreshFailed = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed)); + } + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed, context)); + } + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String certificateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String certificateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String certificateId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, certificateId) + .flatMap((CertificatesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String certificateId) { + getEntityTagAsync(resourceGroupName, serviceName, certificateId).block(); + } + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, certificateId, context).block(); + } + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String certificateId) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateId) + .flatMap( + (CertificatesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateContractInner get(String resourceGroupName, String serviceName, String certificateId) { + return getAsync(resourceGroupName, serviceName, certificateId).block(); + } + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateId, context).block(); + } + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateId, parameters, ifMatch) + .flatMap( + (CertificatesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateId, parameters, ifMatch) + .flatMap( + (CertificatesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, certificateId, parameters, ifMatch).block(); + } + + /** + * Creates or updates the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Create or Update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String certificateId, + CertificateCreateOrUpdateParameters parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, certificateId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String certificateId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String certificateId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String certificateId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, certificateId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String certificateId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, certificateId, ifMatch).block(); + } + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String certificateId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, certificateId, ifMatch, context).block(); + } + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshSecretWithResponseAsync( + String resourceGroupName, String serviceName, String certificateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refreshSecret( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshSecretWithResponseAsync( + String resourceGroupName, String serviceName, String certificateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refreshSecret( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshSecretAsync( + String resourceGroupName, String serviceName, String certificateId) { + return refreshSecretWithResponseAsync(resourceGroupName, serviceName, certificateId) + .flatMap( + (CertificatesRefreshSecretResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateContractInner refreshSecret(String resourceGroupName, String serviceName, String certificateId) { + return refreshSecretAsync(resourceGroupName, serviceName, certificateId).block(); + } + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response refreshSecretWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context) { + return refreshSecretWithResponseAsync(resourceGroupName, serviceName, certificateId, 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 paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesImpl.java new file mode 100644 index 0000000000000..da3cce8a8464c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/CertificatesImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.CertificatesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; +import com.azure.resourcemanager.apimanagement.models.CertificateContract; +import com.azure.resourcemanager.apimanagement.models.Certificates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CertificatesImpl implements Certificates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatesImpl.class); + + private final CertificatesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public CertificatesImpl( + CertificatesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new CertificateContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed, context); + return Utils.mapPage(inner, inner1 -> new CertificateContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String certificateId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, certificateId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, certificateId, context); + } + + public CertificateContract get(String resourceGroupName, String serviceName, String certificateId) { + CertificateContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, certificateId); + if (inner != null) { + return new CertificateContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, certificateId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CertificateContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String certificateId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, certificateId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String certificateId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, certificateId, ifMatch, context); + } + + public CertificateContract refreshSecret(String resourceGroupName, String serviceName, String certificateId) { + CertificateContractInner inner = + this.serviceClient().refreshSecret(resourceGroupName, serviceName, certificateId); + if (inner != null) { + return new CertificateContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response refreshSecretWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context) { + Response inner = + this.serviceClient().refreshSecretWithResponse(resourceGroupName, serviceName, certificateId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CertificateContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CertificateContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificates"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, certificateId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificates"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, certificateId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificates"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, certificateId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificates"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, certificateId, ifMatch, context); + } + + private CertificatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public CertificateContractImpl define(String name) { + return new CertificateContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ClientSecretContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ClientSecretContractImpl.java new file mode 100644 index 0000000000000..d17e522d3f640 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ClientSecretContractImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.models.ClientSecretContract; + +public final class ClientSecretContractImpl implements ClientSecretContract { + private ClientSecretContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ClientSecretContractImpl( + ClientSecretContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String clientSecret() { + return this.innerModel().clientSecret(); + } + + public ClientSecretContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemContractImpl.java new file mode 100644 index 0000000000000..8fe67f60c8447 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; +import com.azure.resourcemanager.apimanagement.models.ContentItemContract; +import java.util.Collections; +import java.util.Map; + +public final class ContentItemContractImpl implements ContentItemContract { + private ContentItemContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ContentItemContractImpl( + ContentItemContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ContentItemContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsClientImpl.java new file mode 100644 index 0000000000000..24787fb7a8316 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsClientImpl.java @@ -0,0 +1,1199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ContentItemsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; +import com.azure.resourcemanager.apimanagement.models.ContentItemCollection; +import com.azure.resourcemanager.apimanagement.models.ContentItemsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ContentItemsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ContentItemsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContentItemsClient. */ +public final class ContentItemsClientImpl implements ContentItemsClient { + private final ClientLogger logger = new ClientLogger(ContentItemsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContentItemsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ContentItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentItemsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ContentItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientContentItems to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientC") + private interface ContentItemsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}/contentItems") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @PathParam("contentItemId") String contentItemId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @PathParam("contentItemId") String contentItemId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @PathParam("contentItemId") String contentItemId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @PathParam("contentItemId") String contentItemId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String contentTypeId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String contentTypeId) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, contentTypeId), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, contentTypeId, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, contentTypeId)); + } + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, contentTypeId, context)); + } + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId) + .flatMap((ContentItemsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + getEntityTagAsync(resourceGroupName, serviceName, contentTypeId, contentItemId).block(); + } + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, context) + .block(); + } + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + return getWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId) + .flatMap( + (ContentItemsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentItemContractInner get( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + return getAsync(resourceGroupName, serviceName, contentTypeId, contentItemId).block(); + } + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, context).block(); + } + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch) + .flatMap( + (ContentItemsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch) + .flatMap( + (ContentItemsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentItemContractInner createOrUpdate( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch).block(); + } + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch, context) + .block(); + } + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String contentTypeId, String contentItemId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (contentItemId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentItemId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + contentItemId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String contentTypeId, String contentItemId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String contentTypeId, String contentItemId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch).block(); + } + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch, 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 paged list of content items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsImpl.java new file mode 100644 index 0000000000000..5cf449e5ae033 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentItemsImpl.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.apimanagement.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.apimanagement.fluent.ContentItemsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; +import com.azure.resourcemanager.apimanagement.models.ContentItemContract; +import com.azure.resourcemanager.apimanagement.models.ContentItems; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContentItemsImpl implements ContentItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentItemsImpl.class); + + private final ContentItemsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ContentItemsImpl( + ContentItemsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, contentTypeId); + return Utils.mapPage(inner, inner1 -> new ContentItemContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, contentTypeId, context); + return Utils.mapPage(inner, inner1 -> new ContentItemContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, contentTypeId, contentItemId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, contentTypeId, contentItemId, context); + } + + public ContentItemContract get( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + ContentItemContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, contentTypeId, contentItemId); + if (inner != null) { + return new ContentItemContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, contentTypeId, contentItemId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContentItemContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContentItemContract createOrUpdate( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId) { + ContentItemContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, contentTypeId, contentItemId); + if (inner != null) { + return new ContentItemContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContentItemContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, contentTypeId, contentItemId, ifMatch, context); + } + + private ContentItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypeContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypeContractImpl.java new file mode 100644 index 0000000000000..355b505af5123 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypeContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; +import com.azure.resourcemanager.apimanagement.models.ContentTypeContract; + +public final class ContentTypeContractImpl implements ContentTypeContract { + private ContentTypeContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ContentTypeContractImpl( + ContentTypeContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String description() { + return this.innerModel().description(); + } + + public Object schema() { + return this.innerModel().schema(); + } + + public String version() { + return this.innerModel().version(); + } + + public ContentTypeContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesClientImpl.java new file mode 100644 index 0000000000000..f799376e5b143 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesClientImpl.java @@ -0,0 +1,924 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ContentTypesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; +import com.azure.resourcemanager.apimanagement.models.ContentTypeCollection; +import com.azure.resourcemanager.apimanagement.models.ContentTypesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ContentTypesGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContentTypesClient. */ +public final class ContentTypesClientImpl implements ContentTypesClient { + private final ClientLogger logger = new ClientLogger(ContentTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContentTypesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ContentTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentTypesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ContentTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientContentTypes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientC") + private interface ContentTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/contentTypes/{contentTypeId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("contentTypeId") String contentTypeId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName)); + } + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, context)); + } + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String contentTypeId) { + return getWithResponseAsync(resourceGroupName, serviceName, contentTypeId) + .flatMap( + (ContentTypesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentTypeContractInner get(String resourceGroupName, String serviceName, String contentTypeId) { + return getAsync(resourceGroupName, serviceName, contentTypeId).block(); + } + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, contentTypeId, context).block(); + } + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, contentTypeId, ifMatch) + .flatMap( + (ContentTypesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String contentTypeId) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, contentTypeId, ifMatch) + .flatMap( + (ContentTypesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContentTypeContractInner createOrUpdate(String resourceGroupName, String serviceName, String contentTypeId) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, contentTypeId, ifMatch).block(); + } + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, contentTypeId, ifMatch, context).block(); + } + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String contentTypeId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String contentTypeId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (contentTypeId == null) { + return Mono.error(new IllegalArgumentException("Parameter contentTypeId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + contentTypeId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String contentTypeId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, contentTypeId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String contentTypeId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, contentTypeId, ifMatch).block(); + } + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, contentTypeId, ifMatch, 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 paged list of content types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesImpl.java new file mode 100644 index 0000000000000..d9801cd070198 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ContentTypesImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ContentTypesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; +import com.azure.resourcemanager.apimanagement.models.ContentTypeContract; +import com.azure.resourcemanager.apimanagement.models.ContentTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContentTypesImpl implements ContentTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentTypesImpl.class); + + private final ContentTypesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ContentTypesImpl( + ContentTypesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ContentTypeContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ContentTypeContractImpl(inner1, this.manager())); + } + + public ContentTypeContract get(String resourceGroupName, String serviceName, String contentTypeId) { + ContentTypeContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, contentTypeId); + if (inner != null) { + return new ContentTypeContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, contentTypeId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContentTypeContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContentTypeContract createOrUpdate(String resourceGroupName, String serviceName, String contentTypeId) { + ContentTypeContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, contentTypeId); + if (inner != null) { + return new ContentTypeContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, contentTypeId, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContentTypeContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String contentTypeId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, contentTypeId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, contentTypeId, ifMatch, context); + } + + private ContentTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsClientImpl.java new file mode 100644 index 0000000000000..662fe70b13694 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsClientImpl.java @@ -0,0 +1,977 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.apimanagement.fluent.DelegationSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingValidationKeyContractInner; +import com.azure.resourcemanager.apimanagement.models.DelegationSettingsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.DelegationSettingsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DelegationSettingsClient. */ +public final class DelegationSettingsClientImpl implements DelegationSettingsClient { + private final ClientLogger logger = new ClientLogger(DelegationSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DelegationSettingsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of DelegationSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DelegationSettingsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(DelegationSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientDelegationSettings to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientD") + private interface DelegationSettingsService { + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/delegation") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/delegation") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/delegation") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalDelegationSettingsInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/delegation") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalDelegationSettingsInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/delegation/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSecrets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName) + .flatMap((DelegationSettingsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName) { + getEntityTagAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName) { + return getWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (DelegationSettingsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalDelegationSettingsInner get(String resourceGroupName, String serviceName) { + return getAsync(resourceGroupName, serviceName).block(); + } + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, String serviceName, String ifMatch, PortalDelegationSettingsInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalDelegationSettingsInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync( + String resourceGroupName, String serviceName, String ifMatch, PortalDelegationSettingsInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, ifMatch, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 update( + String resourceGroupName, String serviceName, String ifMatch, PortalDelegationSettingsInner parameters) { + updateAsync(resourceGroupName, serviceName, ifMatch, parameters).block(); + } + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalDelegationSettingsInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, ifMatch, parameters, context).block(); + } + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + PortalDelegationSettingsInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalDelegationSettingsInner createOrUpdate( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, parameters, ifMatch).block(); + } + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalDelegationSettingsInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch, context).block(); + } + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String serviceName) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalSettingValidationKeyContractInner listSecrets(String resourceGroupName, String serviceName) { + return listSecretsAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsImpl.java new file mode 100644 index 0000000000000..7ecea5f67a9ef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DelegationSettingsImpl.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.apimanagement.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.apimanagement.fluent.DelegationSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingValidationKeyContractInner; +import com.azure.resourcemanager.apimanagement.models.DelegationSettings; +import com.azure.resourcemanager.apimanagement.models.PortalDelegationSettings; +import com.azure.resourcemanager.apimanagement.models.PortalSettingValidationKeyContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DelegationSettingsImpl implements DelegationSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegationSettingsImpl.class); + + private final DelegationSettingsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public DelegationSettingsImpl( + DelegationSettingsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void getEntityTag(String resourceGroupName, String serviceName) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName); + } + + public Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, context); + } + + public PortalDelegationSettings get(String resourceGroupName, String serviceName) { + PortalDelegationSettingsInner inner = this.serviceClient().get(resourceGroupName, serviceName); + if (inner != null) { + return new PortalDelegationSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalDelegationSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void update( + String resourceGroupName, String serviceName, String ifMatch, PortalDelegationSettingsInner parameters) { + this.serviceClient().update(resourceGroupName, serviceName, ifMatch, parameters); + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalDelegationSettingsInner parameters, + Context context) { + return this.serviceClient().updateWithResponse(resourceGroupName, serviceName, ifMatch, parameters, context); + } + + public PortalDelegationSettings createOrUpdate( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters) { + PortalDelegationSettingsInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, parameters); + if (inner != null) { + return new PortalDelegationSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalDelegationSettingsInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalDelegationSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PortalSettingValidationKeyContract listSecrets(String resourceGroupName, String serviceName) { + PortalSettingValidationKeyContractInner inner = + this.serviceClient().listSecrets(resourceGroupName, serviceName); + if (inner != null) { + return new PortalSettingValidationKeyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalSettingValidationKeyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DelegationSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServiceContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServiceContractImpl.java new file mode 100644 index 0000000000000..f0a419b9461c1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServiceContractImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.DeletedServiceContractInner; +import com.azure.resourcemanager.apimanagement.models.DeletedServiceContract; +import java.time.OffsetDateTime; + +public final class DeletedServiceContractImpl implements DeletedServiceContract { + private DeletedServiceContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + DeletedServiceContractImpl( + DeletedServiceContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 String serviceId() { + return this.innerModel().serviceId(); + } + + public OffsetDateTime scheduledPurgeDate() { + return this.innerModel().scheduledPurgeDate(); + } + + public OffsetDateTime deletionDate() { + return this.innerModel().deletionDate(); + } + + public DeletedServiceContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesClientImpl.java new file mode 100644 index 0000000000000..2fc71fe2c4cc4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesClientImpl.java @@ -0,0 +1,716 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.apimanagement.fluent.DeletedServicesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.DeletedServiceContractInner; +import com.azure.resourcemanager.apimanagement.models.DeletedServicesCollection; +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 DeletedServicesClient. */ +public final class DeletedServicesClientImpl implements DeletedServicesClient { + private final ClientLogger logger = new ClientLogger(DeletedServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DeletedServicesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of DeletedServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeletedServicesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(DeletedServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientDeletedServices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientD") + private interface DeletedServicesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices" + + "/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByName( + @HostParam("$host") String endpoint, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices" + + "/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purge( + @HostParam("$host") String endpoint, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByNameWithResponseAsync( + String serviceName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByName( + this.client.getEndpoint(), + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByNameWithResponseAsync( + String serviceName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByName( + this.client.getEndpoint(), + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + accept, + context); + } + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByNameAsync(String serviceName, String location) { + return getByNameWithResponseAsync(serviceName, location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedServiceContractInner getByName(String serviceName, String location) { + return getByNameAsync(serviceName, location).block(); + } + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByNameWithResponse( + String serviceName, String location, Context context) { + return getByNameWithResponseAsync(serviceName, location, context).block(); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync(String serviceName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .purge( + this.client.getEndpoint(), + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeWithResponseAsync( + String serviceName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .purge( + this.client.getEndpoint(), + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + accept, + context); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DeletedServiceContractInner> beginPurgeAsync( + String serviceName, String location) { + Mono>> mono = purgeWithResponseAsync(serviceName, location); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeletedServiceContractInner.class, + DeletedServiceContractInner.class, + Context.NONE); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DeletedServiceContractInner> beginPurgeAsync( + String serviceName, String location, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = purgeWithResponseAsync(serviceName, location, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeletedServiceContractInner.class, + DeletedServiceContractInner.class, + context); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeletedServiceContractInner> beginPurge( + String serviceName, String location) { + return beginPurgeAsync(serviceName, location).getSyncPoller(); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeletedServiceContractInner> beginPurge( + String serviceName, String location, Context context) { + return beginPurgeAsync(serviceName, location, context).getSyncPoller(); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String serviceName, String location) { + return beginPurgeAsync(serviceName, location).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeAsync(String serviceName, String location, Context context) { + return beginPurgeAsync(serviceName, location, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedServiceContractInner purge(String serviceName, String location) { + return purgeAsync(serviceName, location).block(); + } + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedServiceContractInner purge(String serviceName, String location, Context context) { + return purgeAsync(serviceName, location, 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 paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesImpl.java new file mode 100644 index 0000000000000..993b8b18c72a6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DeletedServicesImpl.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.apimanagement.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.apimanagement.fluent.DeletedServicesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.DeletedServiceContractInner; +import com.azure.resourcemanager.apimanagement.models.DeletedServiceContract; +import com.azure.resourcemanager.apimanagement.models.DeletedServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DeletedServicesImpl implements DeletedServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedServicesImpl.class); + + private final DeletedServicesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public DeletedServicesImpl( + DeletedServicesClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DeletedServiceContractImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DeletedServiceContractImpl(inner1, this.manager())); + } + + public DeletedServiceContract getByName(String serviceName, String location) { + DeletedServiceContractInner inner = this.serviceClient().getByName(serviceName, location); + if (inner != null) { + return new DeletedServiceContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByNameWithResponse( + String serviceName, String location, Context context) { + Response inner = + this.serviceClient().getByNameWithResponse(serviceName, location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeletedServiceContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeletedServiceContract purge(String serviceName, String location) { + DeletedServiceContractInner inner = this.serviceClient().purge(serviceName, location); + if (inner != null) { + return new DeletedServiceContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeletedServiceContract purge(String serviceName, String location, Context context) { + DeletedServiceContractInner inner = this.serviceClient().purge(serviceName, location, context); + if (inner != null) { + return new DeletedServiceContractImpl(inner, this.manager()); + } else { + return null; + } + } + + private DeletedServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticContractImpl.java new file mode 100644 index 0000000000000..f4a05b473e0eb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticContractImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; +import com.azure.resourcemanager.apimanagement.models.AlwaysLog; +import com.azure.resourcemanager.apimanagement.models.DiagnosticContract; +import com.azure.resourcemanager.apimanagement.models.HttpCorrelationProtocol; +import com.azure.resourcemanager.apimanagement.models.OperationNameFormat; +import com.azure.resourcemanager.apimanagement.models.PipelineDiagnosticSettings; +import com.azure.resourcemanager.apimanagement.models.SamplingSettings; +import com.azure.resourcemanager.apimanagement.models.Verbosity; + +public final class DiagnosticContractImpl + implements DiagnosticContract, DiagnosticContract.Definition, DiagnosticContract.Update { + private DiagnosticContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AlwaysLog alwaysLog() { + return this.innerModel().alwaysLog(); + } + + public String loggerId() { + return this.innerModel().loggerId(); + } + + public SamplingSettings sampling() { + return this.innerModel().sampling(); + } + + public PipelineDiagnosticSettings frontend() { + return this.innerModel().frontend(); + } + + public PipelineDiagnosticSettings backend() { + return this.innerModel().backend(); + } + + public Boolean logClientIp() { + return this.innerModel().logClientIp(); + } + + public HttpCorrelationProtocol httpCorrelationProtocol() { + return this.innerModel().httpCorrelationProtocol(); + } + + public Verbosity verbosity() { + return this.innerModel().verbosity(); + } + + public OperationNameFormat operationNameFormat() { + return this.innerModel().operationNameFormat(); + } + + public DiagnosticContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String diagnosticId; + + private String createIfMatch; + + private String updateIfMatch; + + public DiagnosticContractImpl withExistingApi(String resourceGroupName, String serviceName, String apiId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + return this; + } + + public DiagnosticContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiDiagnostics() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, diagnosticId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public DiagnosticContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiDiagnostics() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, diagnosticId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + DiagnosticContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new DiagnosticContractInner(); + this.serviceManager = serviceManager; + this.diagnosticId = name; + this.createIfMatch = null; + } + + public DiagnosticContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public DiagnosticContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiDiagnostics() + .updateWithResponse( + resourceGroupName, serviceName, apiId, diagnosticId, updateIfMatch, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DiagnosticContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiDiagnostics() + .updateWithResponse( + resourceGroupName, serviceName, apiId, diagnosticId, updateIfMatch, this.innerModel(), context) + .getValue(); + return this; + } + + DiagnosticContractImpl( + DiagnosticContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.diagnosticId = Utils.getValueFromIdByName(innerObject.id(), "diagnostics"); + } + + public DiagnosticContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiDiagnostics() + .getWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, Context.NONE) + .getValue(); + return this; + } + + public DiagnosticContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiDiagnostics() + .getWithResponse(resourceGroupName, serviceName, apiId, diagnosticId, context) + .getValue(); + return this; + } + + public DiagnosticContractImpl withAlwaysLog(AlwaysLog alwaysLog) { + this.innerModel().withAlwaysLog(alwaysLog); + return this; + } + + public DiagnosticContractImpl withLoggerId(String loggerId) { + this.innerModel().withLoggerId(loggerId); + return this; + } + + public DiagnosticContractImpl withSampling(SamplingSettings sampling) { + this.innerModel().withSampling(sampling); + return this; + } + + public DiagnosticContractImpl withFrontend(PipelineDiagnosticSettings frontend) { + this.innerModel().withFrontend(frontend); + return this; + } + + public DiagnosticContractImpl withBackend(PipelineDiagnosticSettings backend) { + this.innerModel().withBackend(backend); + return this; + } + + public DiagnosticContractImpl withLogClientIp(Boolean logClientIp) { + this.innerModel().withLogClientIp(logClientIp); + return this; + } + + public DiagnosticContractImpl withHttpCorrelationProtocol(HttpCorrelationProtocol httpCorrelationProtocol) { + this.innerModel().withHttpCorrelationProtocol(httpCorrelationProtocol); + return this; + } + + public DiagnosticContractImpl withVerbosity(Verbosity verbosity) { + this.innerModel().withVerbosity(verbosity); + return this; + } + + public DiagnosticContractImpl withOperationNameFormat(OperationNameFormat operationNameFormat) { + this.innerModel().withOperationNameFormat(operationNameFormat); + return this; + } + + public DiagnosticContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsClientImpl.java new file mode 100644 index 0000000000000..df07eabbe3649 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsClientImpl.java @@ -0,0 +1,1436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.DiagnosticsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; +import com.azure.resourcemanager.apimanagement.models.DiagnosticCollection; +import com.azure.resourcemanager.apimanagement.models.DiagnosticsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.DiagnosticsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.DiagnosticsGetResponse; +import com.azure.resourcemanager.apimanagement.models.DiagnosticsUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DiagnosticsClient. */ +public final class DiagnosticsClientImpl implements DiagnosticsClient { + private final ClientLogger logger = new ClientLogger(DiagnosticsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiagnosticsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of DiagnosticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiagnosticsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(DiagnosticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientDiagnostics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientD") + private interface DiagnosticsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/diagnostics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/diagnostics/{diagnosticId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("diagnosticId") String diagnosticId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/diagnostics/{diagnosticId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("diagnosticId") String diagnosticId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/diagnostics/{diagnosticId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("diagnosticId") String diagnosticId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DiagnosticContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/diagnostics/{diagnosticId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("diagnosticId") String diagnosticId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DiagnosticContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/diagnostics/{diagnosticId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("diagnosticId") String diagnosticId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String diagnosticId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String diagnosticId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String diagnosticId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, diagnosticId) + .flatMap((DiagnosticsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String diagnosticId) { + getEntityTagAsync(resourceGroupName, serviceName, diagnosticId).block(); + } + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, diagnosticId, context).block(); + } + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String diagnosticId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String diagnosticId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String diagnosticId) { + return getWithResponseAsync(resourceGroupName, serviceName, diagnosticId) + .flatMap( + (DiagnosticsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticContractInner get(String resourceGroupName, String serviceName, String diagnosticId) { + return getAsync(resourceGroupName, serviceName, diagnosticId).block(); + } + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, diagnosticId, context).block(); + } + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, diagnosticId, parameters, ifMatch) + .flatMap( + (DiagnosticsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String diagnosticId, DiagnosticContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, diagnosticId, parameters, ifMatch) + .flatMap( + (DiagnosticsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticContractInner createOrUpdate( + String resourceGroupName, String serviceName, String diagnosticId, DiagnosticContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, diagnosticId, parameters, ifMatch).block(); + } + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, diagnosticId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, diagnosticId, ifMatch, parameters) + .flatMap( + (DiagnosticsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticContractInner update( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters) { + return updateAsync(resourceGroupName, serviceName, diagnosticId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, diagnosticId, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String diagnosticId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String diagnosticId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (diagnosticId == null) { + return Mono.error(new IllegalArgumentException("Parameter diagnosticId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + diagnosticId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String diagnosticId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, diagnosticId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String diagnosticId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, diagnosticId, ifMatch).block(); + } + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, diagnosticId, ifMatch, 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 paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsImpl.java new file mode 100644 index 0000000000000..eb64093bb2493 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/DiagnosticsImpl.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.apimanagement.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.apimanagement.fluent.DiagnosticsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; +import com.azure.resourcemanager.apimanagement.models.DiagnosticContract; +import com.azure.resourcemanager.apimanagement.models.Diagnostics; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiagnosticsImpl implements Diagnostics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsImpl.class); + + private final DiagnosticsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public DiagnosticsImpl( + DiagnosticsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new DiagnosticContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new DiagnosticContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String diagnosticId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, diagnosticId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, diagnosticId, context); + } + + public DiagnosticContract get(String resourceGroupName, String serviceName, String diagnosticId) { + DiagnosticContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, diagnosticId); + if (inner != null) { + return new DiagnosticContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, diagnosticId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DiagnosticContract createOrUpdate( + String resourceGroupName, String serviceName, String diagnosticId, DiagnosticContractInner parameters) { + DiagnosticContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, diagnosticId, parameters); + if (inner != null) { + return new DiagnosticContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, diagnosticId, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DiagnosticContract update( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters) { + DiagnosticContractInner inner = + this.serviceClient().update(resourceGroupName, serviceName, diagnosticId, ifMatch, parameters); + if (inner != null) { + return new DiagnosticContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse(resourceGroupName, serviceName, diagnosticId, ifMatch, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiagnosticContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String diagnosticId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, diagnosticId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, diagnosticId, ifMatch, context); + } + + private DiagnosticsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplateContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplateContractImpl.java new file mode 100644 index 0000000000000..5ed2bcff432fe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplateContractImpl.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateContract; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateParametersContractProperties; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.TemplateName; +import java.util.Collections; +import java.util.List; + +public final class EmailTemplateContractImpl + implements EmailTemplateContract, EmailTemplateContract.Definition, EmailTemplateContract.Update { + private EmailTemplateContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String subject() { + return this.innerModel().subject(); + } + + public String body() { + return this.innerModel().body(); + } + + public String title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean isDefault() { + return this.innerModel().isDefault(); + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public EmailTemplateContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private TemplateName templateName; + + private String createIfMatch; + + private EmailTemplateUpdateParameters createParameters; + + private String updateIfMatch; + + private EmailTemplateUpdateParameters updateParameters; + + public EmailTemplateContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public EmailTemplateContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getEmailTemplates() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, templateName, createParameters, createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public EmailTemplateContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEmailTemplates() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, templateName, createParameters, createIfMatch, context) + .getValue(); + return this; + } + + EmailTemplateContractImpl( + TemplateName name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new EmailTemplateContractInner(); + this.serviceManager = serviceManager; + this.templateName = name; + this.createIfMatch = null; + this.createParameters = new EmailTemplateUpdateParameters(); + } + + public EmailTemplateContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new EmailTemplateUpdateParameters(); + return this; + } + + public EmailTemplateContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getEmailTemplates() + .updateWithResponse( + resourceGroupName, serviceName, templateName, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public EmailTemplateContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEmailTemplates() + .updateWithResponse( + resourceGroupName, serviceName, templateName, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + EmailTemplateContractImpl( + EmailTemplateContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.templateName = TemplateName.fromString(Utils.getValueFromIdByName(innerObject.id(), "templates")); + } + + public EmailTemplateContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEmailTemplates() + .getWithResponse(resourceGroupName, serviceName, templateName, Context.NONE) + .getValue(); + return this; + } + + public EmailTemplateContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEmailTemplates() + .getWithResponse(resourceGroupName, serviceName, templateName, context) + .getValue(); + return this; + } + + public EmailTemplateContractImpl withSubject(String subject) { + if (isInCreateMode()) { + this.createParameters.withSubject(subject); + return this; + } else { + this.updateParameters.withSubject(subject); + return this; + } + } + + public EmailTemplateContractImpl withTitle(String title) { + if (isInCreateMode()) { + this.createParameters.withTitle(title); + return this; + } else { + this.updateParameters.withTitle(title); + return this; + } + } + + public EmailTemplateContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.createParameters.withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public EmailTemplateContractImpl withBody(String body) { + if (isInCreateMode()) { + this.createParameters.withBody(body); + return this; + } else { + this.updateParameters.withBody(body); + return this; + } + } + + public EmailTemplateContractImpl withParameters(List parameters) { + if (isInCreateMode()) { + this.createParameters.withParameters(parameters); + return this; + } else { + this.updateParameters.withParameters(parameters); + return this; + } + } + + public EmailTemplateContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesClientImpl.java new file mode 100644 index 0000000000000..65a0d556355cc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesClientImpl.java @@ -0,0 +1,1445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.EmailTemplatesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateCollection; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.EmailTemplatesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.EmailTemplatesGetResponse; +import com.azure.resourcemanager.apimanagement.models.EmailTemplatesUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.TemplateName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EmailTemplatesClient. */ +public final class EmailTemplatesClientImpl implements EmailTemplatesClient { + private final ClientLogger logger = new ClientLogger(EmailTemplatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EmailTemplatesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of EmailTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EmailTemplatesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(EmailTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientEmailTemplates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientE") + private interface EmailTemplatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/templates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/templates/{templateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("templateName") TemplateName templateName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/templates/{templateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("templateName") TemplateName templateName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/templates/{templateName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("templateName") TemplateName templateName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") EmailTemplateUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/templates/{templateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("templateName") TemplateName templateName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") EmailTemplateUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/templates/{templateName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("templateName") TemplateName templateName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, TemplateName templateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, TemplateName templateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, TemplateName templateName) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, templateName) + .flatMap((EmailTemplatesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, TemplateName templateName) { + getEntityTagAsync(resourceGroupName, serviceName, templateName).block(); + } + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, templateName, context).block(); + } + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, TemplateName templateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, TemplateName templateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, TemplateName templateName) { + return getWithResponseAsync(resourceGroupName, serviceName, templateName) + .flatMap( + (EmailTemplatesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmailTemplateContractInner get(String resourceGroupName, String serviceName, TemplateName templateName) { + return getAsync(resourceGroupName, serviceName, templateName).block(); + } + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, templateName, context).block(); + } + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, templateName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, templateName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmailTemplateContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, templateName, parameters, ifMatch).block(); + } + + /** + * Updates an Email Template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param parameters Email Template update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + TemplateName templateName, + EmailTemplateUpdateParameters parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, templateName, parameters, ifMatch, context) + .block(); + } + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, templateName, ifMatch, parameters) + .flatMap( + (EmailTemplatesUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmailTemplateContractInner update( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, templateName, ifMatch, parameters).block(); + } + + /** + * Updates API Management email template. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return email Template details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + TemplateName templateName, + String ifMatch, + EmailTemplateUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, templateName, ifMatch, parameters, context) + .block(); + } + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, TemplateName templateName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, TemplateName templateName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (templateName == null) { + return Mono.error(new IllegalArgumentException("Parameter templateName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + templateName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, TemplateName templateName, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, templateName, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, TemplateName templateName, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, templateName, ifMatch).block(); + } + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, templateName, ifMatch, 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 paged email template list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged email template list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesImpl.java new file mode 100644 index 0000000000000..c850a773fc2b6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/EmailTemplatesImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.EmailTemplatesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; +import com.azure.resourcemanager.apimanagement.models.EmailTemplateContract; +import com.azure.resourcemanager.apimanagement.models.EmailTemplates; +import com.azure.resourcemanager.apimanagement.models.TemplateName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EmailTemplatesImpl implements EmailTemplates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplatesImpl.class); + + private final EmailTemplatesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public EmailTemplatesImpl( + EmailTemplatesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new EmailTemplateContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new EmailTemplateContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, TemplateName templateName) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, templateName); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, templateName, context); + } + + public EmailTemplateContract get(String resourceGroupName, String serviceName, TemplateName templateName) { + EmailTemplateContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, templateName); + if (inner != null) { + return new EmailTemplateContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, templateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EmailTemplateContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, TemplateName templateName, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, templateName, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, templateName, ifMatch, context); + } + + public EmailTemplateContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + TemplateName templateName = TemplateName.fromString(Utils.getValueFromIdByName(id, "templates")); + if (templateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'templates'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, templateName, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + TemplateName templateName = TemplateName.fromString(Utils.getValueFromIdByName(id, "templates")); + if (templateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'templates'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, templateName, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + TemplateName templateName = TemplateName.fromString(Utils.getValueFromIdByName(id, "templates")); + if (templateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'templates'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, templateName, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + TemplateName templateName = TemplateName.fromString(Utils.getValueFromIdByName(id, "templates")); + if (templateName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'templates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, templateName, ifMatch, context); + } + + private EmailTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public EmailTemplateContractImpl define(TemplateName name) { + return new EmailTemplateContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisClientImpl.java new file mode 100644 index 0000000000000..45dc34cd926ca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisClientImpl.java @@ -0,0 +1,1076 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.GatewayApisClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiCollection; +import com.azure.resourcemanager.apimanagement.models.AssociationContract; +import com.azure.resourcemanager.apimanagement.models.GatewayApisGetEntityTagResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GatewayApisClient. */ +public final class GatewayApisClientImpl implements GatewayApisClient { + private final ClientLogger logger = new ClientLogger(GatewayApisClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GatewayApisService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of GatewayApisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewayApisClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(GatewayApisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientGatewayApis to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientG") + private interface GatewayApisService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/apis") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AssociationContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String gatewayId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String gatewayId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip)); + } + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip, context)); + } + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagAsync(String resourceGroupName, String serviceName, String gatewayId, String apiId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId) + .flatMap((GatewayApisGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String apiId) { + getEntityTagAsync(resourceGroupName, serviceName, gatewayId, apiId).block(); + } + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId, context).block(); + } + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param parameters Association entity details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String apiId, AssociationContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and 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) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param parameters Association entity details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String apiId, + AssociationContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and 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) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param parameters Association entity details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String gatewayId, String apiId, AssociationContract parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String gatewayId, String apiId) { + final AssociationContract parameters = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner createOrUpdate( + String resourceGroupName, String serviceName, String gatewayId, String apiId) { + final AssociationContract parameters = null; + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayId, apiId, parameters).block(); + } + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param parameters Association entity details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String apiId, + AssociationContract parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId, parameters, context) + .block(); + } + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String apiId) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayId, String apiId) { + deleteAsync(resourceGroupName, serviceName, gatewayId, apiId).block(); + } + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, apiId, 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 paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisImpl.java new file mode 100644 index 0000000000000..39f8b7a6c6ca7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayApisImpl.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.apimanagement.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.apimanagement.fluent.GatewayApisClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiContract; +import com.azure.resourcemanager.apimanagement.models.AssociationContract; +import com.azure.resourcemanager.apimanagement.models.GatewayApis; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewayApisImpl implements GatewayApis { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayApisImpl.class); + + private final GatewayApisClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public GatewayApisImpl( + GatewayApisClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName, String gatewayId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, gatewayId); + return Utils.mapPage(inner, inner1 -> new ApiContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, gatewayId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ApiContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String apiId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, gatewayId, apiId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, gatewayId, apiId, context); + } + + public ApiContract createOrUpdate(String resourceGroupName, String serviceName, String gatewayId, String apiId) { + ApiContractInner inner = this.serviceClient().createOrUpdate(resourceGroupName, serviceName, gatewayId, apiId); + if (inner != null) { + return new ApiContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String apiId, + AssociationContract parameters, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, gatewayId, apiId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String gatewayId, String apiId) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayId, apiId); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, gatewayId, apiId, context); + } + + private GatewayApisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesClientImpl.java new file mode 100644 index 0000000000000..67cf3a7102ea2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesClientImpl.java @@ -0,0 +1,1373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.GatewayCertificateAuthoritiesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthoritiesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthoritiesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthoritiesGetResponse; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthorityCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GatewayCertificateAuthoritiesClient. */ +public final class GatewayCertificateAuthoritiesClientImpl implements GatewayCertificateAuthoritiesClient { + private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthoritiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GatewayCertificateAuthoritiesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of GatewayCertificateAuthoritiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewayCertificateAuthoritiesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create( + GatewayCertificateAuthoritiesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientGatewayCertificateAuthorities to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientG") + private interface GatewayCertificateAuthoritiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("certificateId") String certificateId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("certificateId") String certificateId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("certificateId") String certificateId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GatewayCertificateAuthorityContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("certificateId") String certificateId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String gatewayId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String gatewayId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip)); + } + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip, context)); + } + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagAsync( + String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, certificateId) + .flatMap((GatewayCertificateAuthoritiesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + getEntityTagAsync(resourceGroupName, serviceName, gatewayId, certificateId).block(); + } + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, certificateId, context).block(); + } + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayId, certificateId) + .flatMap( + (GatewayCertificateAuthoritiesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayCertificateAuthorityContractInner get( + String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + return getAsync(resourceGroupName, serviceName, gatewayId, certificateId).block(); + } + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayId, certificateId, context).block(); + } + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayId, certificateId, parameters, ifMatch) + .flatMap( + (GatewayCertificateAuthoritiesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayId, certificateId, parameters, ifMatch) + .flatMap( + (GatewayCertificateAuthoritiesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayCertificateAuthorityContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayId, certificateId, parameters, ifMatch) + .block(); + } + + /** + * Assign Certificate entity to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param parameters Gateway certificate authority details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway certificate authority details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + GatewayCertificateAuthorityContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayId, certificateId, parameters, ifMatch, context) + .block(); + } + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String certificateId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String gatewayId, + String certificateId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (certificateId == null) { + return Mono.error(new IllegalArgumentException("Parameter certificateId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + certificateId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String certificateId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayId, String certificateId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch).block(); + } + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch, 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 paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesImpl.java new file mode 100644 index 0000000000000..6c26b6f68395a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthoritiesImpl.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.apimanagement.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.apimanagement.fluent.GatewayCertificateAuthoritiesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthorities; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthorityContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewayCertificateAuthoritiesImpl implements GatewayCertificateAuthorities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthoritiesImpl.class); + + private final GatewayCertificateAuthoritiesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public GatewayCertificateAuthoritiesImpl( + GatewayCertificateAuthoritiesClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, gatewayId); + return Utils.mapPage(inner, inner1 -> new GatewayCertificateAuthorityContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, gatewayId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new GatewayCertificateAuthorityContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, gatewayId, certificateId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, context); + } + + public GatewayCertificateAuthorityContract get( + String resourceGroupName, String serviceName, String gatewayId, String certificateId) { + GatewayCertificateAuthorityContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, gatewayId, certificateId); + if (inner != null) { + return new GatewayCertificateAuthorityContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayCertificateAuthorityContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch, context); + } + + public GatewayCertificateAuthorityContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificateAuthorities"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'certificateAuthorities'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificateAuthorities"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'certificateAuthorities'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificateAuthorities"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'certificateAuthorities'.", + id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String certificateId = Utils.getValueFromIdByName(id, "certificateAuthorities"); + if (certificateId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'certificateAuthorities'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, ifMatch, context); + } + + private GatewayCertificateAuthoritiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public GatewayCertificateAuthorityContractImpl define(String name) { + return new GatewayCertificateAuthorityContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthorityContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthorityContractImpl.java new file mode 100644 index 0000000000000..d2d32a5c38eb2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayCertificateAuthorityContractImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayCertificateAuthorityContract; + +public final class GatewayCertificateAuthorityContractImpl + implements GatewayCertificateAuthorityContract, + GatewayCertificateAuthorityContract.Definition, + GatewayCertificateAuthorityContract.Update { + private GatewayCertificateAuthorityContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean isTrusted() { + return this.innerModel().isTrusted(); + } + + public GatewayCertificateAuthorityContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String gatewayId; + + private String certificateId; + + private String createIfMatch; + + private String updateIfMatch; + + public GatewayCertificateAuthorityContractImpl withExistingGateway( + String resourceGroupName, String serviceName, String gatewayId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.gatewayId = gatewayId; + return this; + } + + public GatewayCertificateAuthorityContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCertificateAuthorities() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + gatewayId, + certificateId, + this.innerModel(), + createIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public GatewayCertificateAuthorityContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCertificateAuthorities() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, certificateId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + GatewayCertificateAuthorityContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new GatewayCertificateAuthorityContractInner(); + this.serviceManager = serviceManager; + this.certificateId = name; + this.createIfMatch = null; + } + + public GatewayCertificateAuthorityContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public GatewayCertificateAuthorityContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCertificateAuthorities() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + gatewayId, + certificateId, + this.innerModel(), + updateIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public GatewayCertificateAuthorityContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCertificateAuthorities() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, certificateId, this.innerModel(), updateIfMatch, context) + .getValue(); + return this; + } + + GatewayCertificateAuthorityContractImpl( + GatewayCertificateAuthorityContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.gatewayId = Utils.getValueFromIdByName(innerObject.id(), "gateways"); + this.certificateId = Utils.getValueFromIdByName(innerObject.id(), "certificateAuthorities"); + } + + public GatewayCertificateAuthorityContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCertificateAuthorities() + .getWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, Context.NONE) + .getValue(); + return this; + } + + public GatewayCertificateAuthorityContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCertificateAuthorities() + .getWithResponse(resourceGroupName, serviceName, gatewayId, certificateId, context) + .getValue(); + return this; + } + + public GatewayCertificateAuthorityContractImpl withIsTrusted(Boolean isTrusted) { + this.innerModel().withIsTrusted(isTrusted); + return this; + } + + public GatewayCertificateAuthorityContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayContractImpl.java new file mode 100644 index 0000000000000..adbf06103ac52 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayContractImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayContract; +import com.azure.resourcemanager.apimanagement.models.GatewayKeyRegenerationRequestContract; +import com.azure.resourcemanager.apimanagement.models.GatewayKeysContract; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenContract; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenRequestContract; +import com.azure.resourcemanager.apimanagement.models.ResourceLocationDataContract; + +public final class GatewayContractImpl implements GatewayContract, GatewayContract.Definition, GatewayContract.Update { + private GatewayContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ResourceLocationDataContract locationData() { + return this.innerModel().locationData(); + } + + public String description() { + return this.innerModel().description(); + } + + public GatewayContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String gatewayId; + + private String createIfMatch; + + private String updateIfMatch; + + public GatewayContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public GatewayContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public GatewayContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + GatewayContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new GatewayContractInner(); + this.serviceManager = serviceManager; + this.gatewayId = name; + this.createIfMatch = null; + } + + public GatewayContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public GatewayContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .updateWithResponse( + resourceGroupName, serviceName, gatewayId, updateIfMatch, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public GatewayContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .updateWithResponse( + resourceGroupName, serviceName, gatewayId, updateIfMatch, this.innerModel(), context) + .getValue(); + return this; + } + + GatewayContractImpl( + GatewayContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.gatewayId = Utils.getValueFromIdByName(innerObject.id(), "gateways"); + } + + public GatewayContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .getWithResponse(resourceGroupName, serviceName, gatewayId, Context.NONE) + .getValue(); + return this; + } + + public GatewayContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .getWithResponse(resourceGroupName, serviceName, gatewayId, context) + .getValue(); + return this; + } + + public GatewayKeysContract listKeys() { + return serviceManager.gateways().listKeys(resourceGroupName, serviceName, gatewayId); + } + + public Response listKeysWithResponse(Context context) { + return serviceManager.gateways().listKeysWithResponse(resourceGroupName, serviceName, gatewayId, context); + } + + public void regenerateKey(GatewayKeyRegenerationRequestContract parameters) { + serviceManager.gateways().regenerateKey(resourceGroupName, serviceName, gatewayId, parameters); + } + + public Response regenerateKeyWithResponse(GatewayKeyRegenerationRequestContract parameters, Context context) { + return serviceManager + .gateways() + .regenerateKeyWithResponse(resourceGroupName, serviceName, gatewayId, parameters, context); + } + + public GatewayTokenContract generateToken(GatewayTokenRequestContract parameters) { + return serviceManager.gateways().generateToken(resourceGroupName, serviceName, gatewayId, parameters); + } + + public Response generateTokenWithResponse( + GatewayTokenRequestContract parameters, Context context) { + return serviceManager + .gateways() + .generateTokenWithResponse(resourceGroupName, serviceName, gatewayId, parameters, context); + } + + public GatewayContractImpl withLocationData(ResourceLocationDataContract locationData) { + this.innerModel().withLocationData(locationData); + return this; + } + + public GatewayContractImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public GatewayContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationContractImpl.java new file mode 100644 index 0000000000000..408fd5f0914fe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationContractImpl.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.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurationContract; + +public final class GatewayHostnameConfigurationContractImpl + implements GatewayHostnameConfigurationContract, + GatewayHostnameConfigurationContract.Definition, + GatewayHostnameConfigurationContract.Update { + private GatewayHostnameConfigurationContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager 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 String certificateId() { + return this.innerModel().certificateId(); + } + + public Boolean negotiateClientCertificate() { + return this.innerModel().negotiateClientCertificate(); + } + + public Boolean tls10Enabled() { + return this.innerModel().tls10Enabled(); + } + + public Boolean tls11Enabled() { + return this.innerModel().tls11Enabled(); + } + + public Boolean http2Enabled() { + return this.innerModel().http2Enabled(); + } + + public GatewayHostnameConfigurationContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String gatewayId; + + private String hcId; + + private String createIfMatch; + + private String updateIfMatch; + + public GatewayHostnameConfigurationContractImpl withExistingGateway( + String resourceGroupName, String serviceName, String gatewayId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.gatewayId = gatewayId; + return this; + } + + public GatewayHostnameConfigurationContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayHostnameConfigurations() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, hcId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public GatewayHostnameConfigurationContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayHostnameConfigurations() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, hcId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + GatewayHostnameConfigurationContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new GatewayHostnameConfigurationContractInner(); + this.serviceManager = serviceManager; + this.hcId = name; + this.createIfMatch = null; + } + + public GatewayHostnameConfigurationContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public GatewayHostnameConfigurationContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayHostnameConfigurations() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, hcId, this.innerModel(), updateIfMatch, Context.NONE) + .getValue(); + return this; + } + + public GatewayHostnameConfigurationContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayHostnameConfigurations() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, gatewayId, hcId, this.innerModel(), updateIfMatch, context) + .getValue(); + return this; + } + + GatewayHostnameConfigurationContractImpl( + GatewayHostnameConfigurationContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.gatewayId = Utils.getValueFromIdByName(innerObject.id(), "gateways"); + this.hcId = Utils.getValueFromIdByName(innerObject.id(), "hostnameConfigurations"); + } + + public GatewayHostnameConfigurationContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayHostnameConfigurations() + .getWithResponse(resourceGroupName, serviceName, gatewayId, hcId, Context.NONE) + .getValue(); + return this; + } + + public GatewayHostnameConfigurationContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayHostnameConfigurations() + .getWithResponse(resourceGroupName, serviceName, gatewayId, hcId, context) + .getValue(); + return this; + } + + public GatewayHostnameConfigurationContractImpl withHostname(String hostname) { + this.innerModel().withHostname(hostname); + return this; + } + + public GatewayHostnameConfigurationContractImpl withCertificateId(String certificateId) { + this.innerModel().withCertificateId(certificateId); + return this; + } + + public GatewayHostnameConfigurationContractImpl withNegotiateClientCertificate(Boolean negotiateClientCertificate) { + this.innerModel().withNegotiateClientCertificate(negotiateClientCertificate); + return this; + } + + public GatewayHostnameConfigurationContractImpl withTls10Enabled(Boolean tls10Enabled) { + this.innerModel().withTls10Enabled(tls10Enabled); + return this; + } + + public GatewayHostnameConfigurationContractImpl withTls11Enabled(Boolean tls11Enabled) { + this.innerModel().withTls11Enabled(tls11Enabled); + return this; + } + + public GatewayHostnameConfigurationContractImpl withHttp2Enabled(Boolean http2Enabled) { + this.innerModel().withHttp2Enabled(http2Enabled); + return this; + } + + public GatewayHostnameConfigurationContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsClientImpl.java new file mode 100644 index 0000000000000..2825f4ec56ea2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsClientImpl.java @@ -0,0 +1,1341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.GatewayHostnameConfigurationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurationCollection; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurationsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurationsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurationsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GatewayHostnameConfigurationsClient. */ +public final class GatewayHostnameConfigurationsClientImpl implements GatewayHostnameConfigurationsClient { + private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GatewayHostnameConfigurationsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of GatewayHostnameConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewayHostnameConfigurationsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create( + GatewayHostnameConfigurationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientGatewayHostnameConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientG") + private interface GatewayHostnameConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("hcId") String hcId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("hcId") String hcId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("hcId") String hcId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GatewayHostnameConfigurationContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @PathParam("hcId") String hcId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String gatewayId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String gatewayId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip)); + } + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, gatewayId, filter, top, skip, context)); + } + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String hcId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getEntityTagAsync(String resourceGroupName, String serviceName, String gatewayId, String hcId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId) + .flatMap((GatewayHostnameConfigurationsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String hcId) { + getEntityTagAsync(resourceGroupName, serviceName, gatewayId, hcId).block(); + } + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId, context).block(); + } + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String hcId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String gatewayId, String hcId) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId) + .flatMap( + (GatewayHostnameConfigurationsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayHostnameConfigurationContractInner get( + String resourceGroupName, String serviceName, String gatewayId, String hcId) { + return getAsync(resourceGroupName, serviceName, gatewayId, hcId).block(); + } + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId, context).block(); + } + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId, parameters, ifMatch) + .flatMap( + (GatewayHostnameConfigurationsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId, parameters, ifMatch) + .flatMap( + (GatewayHostnameConfigurationsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayHostnameConfigurationContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayId, hcId, parameters, ifMatch).block(); + } + + /** + * Creates of updates hostname configuration for a Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param parameters Gateway hostname configuration details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway hostname configuration details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String hcId, + GatewayHostnameConfigurationContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayId, hcId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String hcId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String hcId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (hcId == null) { + return Mono.error(new IllegalArgumentException("Parameter hcId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + hcId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String hcId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayId, String hcId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, gatewayId, hcId, ifMatch).block(); + } + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, hcId, ifMatch, 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 paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsImpl.java new file mode 100644 index 0000000000000..541b25fcbad5e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayHostnameConfigurationsImpl.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.GatewayHostnameConfigurationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurationContract; +import com.azure.resourcemanager.apimanagement.models.GatewayHostnameConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewayHostnameConfigurationsImpl implements GatewayHostnameConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationsImpl.class); + + private final GatewayHostnameConfigurationsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public GatewayHostnameConfigurationsImpl( + GatewayHostnameConfigurationsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, gatewayId); + return Utils.mapPage(inner, inner1 -> new GatewayHostnameConfigurationContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, gatewayId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new GatewayHostnameConfigurationContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String hcId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, gatewayId, hcId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, gatewayId, hcId, context); + } + + public GatewayHostnameConfigurationContract get( + String resourceGroupName, String serviceName, String gatewayId, String hcId) { + GatewayHostnameConfigurationContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, gatewayId, hcId); + if (inner != null) { + return new GatewayHostnameConfigurationContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, gatewayId, hcId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayHostnameConfigurationContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String gatewayId, String hcId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayId, hcId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, String ifMatch, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, gatewayId, hcId, ifMatch, context); + } + + public GatewayHostnameConfigurationContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String hcId = Utils.getValueFromIdByName(id, "hostnameConfigurations"); + if (hcId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hostnameConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayId, hcId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String hcId = Utils.getValueFromIdByName(id, "hostnameConfigurations"); + if (hcId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hostnameConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayId, hcId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String hcId = Utils.getValueFromIdByName(id, "hostnameConfigurations"); + if (hcId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hostnameConfigurations'.", + id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, gatewayId, hcId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String hcId = Utils.getValueFromIdByName(id, "hostnameConfigurations"); + if (hcId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hostnameConfigurations'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, gatewayId, hcId, ifMatch, context); + } + + private GatewayHostnameConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public GatewayHostnameConfigurationContractImpl define(String name) { + return new GatewayHostnameConfigurationContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayKeysContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayKeysContractImpl.java new file mode 100644 index 0000000000000..d1f163409f0a4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayKeysContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayKeysContract; + +public final class GatewayKeysContractImpl implements GatewayKeysContract { + private GatewayKeysContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + GatewayKeysContractImpl( + GatewayKeysContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primary() { + return this.innerModel().primary(); + } + + public String secondary() { + return this.innerModel().secondary(); + } + + public GatewayKeysContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayTokenContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayTokenContractImpl.java new file mode 100644 index 0000000000000..e6e8a4b982333 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewayTokenContractImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayTokenContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenContract; + +public final class GatewayTokenContractImpl implements GatewayTokenContract { + private GatewayTokenContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + GatewayTokenContractImpl( + GatewayTokenContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String value() { + return this.innerModel().value(); + } + + public GatewayTokenContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysClientImpl.java new file mode 100644 index 0000000000000..a7155e1170e96 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysClientImpl.java @@ -0,0 +1,2082 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.GatewaysClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayTokenContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayCollection; +import com.azure.resourcemanager.apimanagement.models.GatewayKeyRegenerationRequestContract; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenRequestContract; +import com.azure.resourcemanager.apimanagement.models.GatewaysCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.GatewaysGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.GatewaysGetResponse; +import com.azure.resourcemanager.apimanagement.models.GatewaysListKeysResponse; +import com.azure.resourcemanager.apimanagement.models.GatewaysUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GatewaysClient. */ +public final class GatewaysClientImpl implements GatewaysClient { + private final ClientLogger logger = new ClientLogger(GatewaysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GatewaysService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of GatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewaysClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(GatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientGateways to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientG") + private interface GatewaysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GatewayContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GatewayContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/regenerateKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GatewayKeyRegenerationRequestContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/gateways/{gatewayId}/generateToken") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateToken( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayId") String gatewayId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GatewayTokenRequestContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String gatewayId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId) + .flatMap((GatewaysGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId) { + getEntityTagAsync(resourceGroupName, serviceName, gatewayId).block(); + } + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, gatewayId, context).block(); + } + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String gatewayId) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayId) + .flatMap( + (GatewaysGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayContractInner get(String resourceGroupName, String serviceName, String gatewayId) { + return getAsync(resourceGroupName, serviceName, gatewayId).block(); + } + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayId, context).block(); + } + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters, ifMatch) + .flatMap( + (GatewaysCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String gatewayId, GatewayContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters, ifMatch) + .flatMap( + (GatewaysCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayContractInner createOrUpdate( + String resourceGroupName, String serviceName, String gatewayId, GatewayContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayId, parameters, ifMatch).block(); + } + + /** + * Creates or updates a Gateway to be used in Api Management instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway details. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, gatewayId, ifMatch, parameters) + .flatMap( + (GatewaysUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayContractInner update( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner parameters) { + return updateAsync(resourceGroupName, serviceName, gatewayId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Gateway details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String ifMatch, + GatewayContractInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, gatewayId, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, gatewayId, ifMatch).block(); + } + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, gatewayId, ifMatch, context).block(); + } + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String serviceName, String gatewayId) { + return listKeysWithResponseAsync(resourceGroupName, serviceName, gatewayId) + .flatMap( + (GatewaysListKeysResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayKeysContractInner listKeys(String resourceGroupName, String serviceName, String gatewayId) { + return listKeysAsync(resourceGroupName, serviceName, gatewayId).block(); + } + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + return listKeysWithResponseAsync(resourceGroupName, serviceName, gatewayId, context).block(); + } + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> regenerateKeyWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> regenerateKeyWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 regenerateKeyAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters) { + return regenerateKeyWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 regenerateKey( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters) { + regenerateKeyAsync(resourceGroupName, serviceName, gatewayId, parameters).block(); + } + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeyWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters, + Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters, context).block(); + } + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateTokenWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayId, GatewayTokenRequestContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateToken( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateTokenWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayTokenRequestContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateToken( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + gatewayId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateTokenAsync( + String resourceGroupName, String serviceName, String gatewayId, GatewayTokenRequestContract parameters) { + return generateTokenWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayTokenContractInner generateToken( + String resourceGroupName, String serviceName, String gatewayId, GatewayTokenRequestContract parameters) { + return generateTokenAsync(resourceGroupName, serviceName, gatewayId, parameters).block(); + } + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateTokenWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayTokenRequestContract parameters, + Context context) { + return generateTokenWithResponseAsync(resourceGroupName, serviceName, gatewayId, parameters, 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 paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysImpl.java new file mode 100644 index 0000000000000..a489aafac85ea --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GatewaysImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.GatewaysClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayTokenContractInner; +import com.azure.resourcemanager.apimanagement.models.GatewayContract; +import com.azure.resourcemanager.apimanagement.models.GatewayKeyRegenerationRequestContract; +import com.azure.resourcemanager.apimanagement.models.GatewayKeysContract; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenContract; +import com.azure.resourcemanager.apimanagement.models.GatewayTokenRequestContract; +import com.azure.resourcemanager.apimanagement.models.Gateways; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewaysImpl implements Gateways { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaysImpl.class); + + private final GatewaysClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public GatewaysImpl( + GatewaysClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new GatewayContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new GatewayContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String gatewayId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, gatewayId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, gatewayId, context); + } + + public GatewayContract get(String resourceGroupName, String serviceName, String gatewayId) { + GatewayContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, gatewayId); + if (inner != null) { + return new GatewayContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, gatewayId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String gatewayId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, gatewayId, ifMatch, context); + } + + public GatewayKeysContract listKeys(String resourceGroupName, String serviceName, String gatewayId) { + GatewayKeysContractInner inner = this.serviceClient().listKeys(resourceGroupName, serviceName, gatewayId); + if (inner != null) { + return new GatewayKeysContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, serviceName, gatewayId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayKeysContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void regenerateKey( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters) { + this.serviceClient().regenerateKey(resourceGroupName, serviceName, gatewayId, parameters); + } + + public Response regenerateKeyWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters, + Context context) { + return this + .serviceClient() + .regenerateKeyWithResponse(resourceGroupName, serviceName, gatewayId, parameters, context); + } + + public GatewayTokenContract generateToken( + String resourceGroupName, String serviceName, String gatewayId, GatewayTokenRequestContract parameters) { + GatewayTokenContractInner inner = + this.serviceClient().generateToken(resourceGroupName, serviceName, gatewayId, parameters); + if (inner != null) { + return new GatewayTokenContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateTokenWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayTokenRequestContract parameters, + Context context) { + Response inner = + this + .serviceClient() + .generateTokenWithResponse(resourceGroupName, serviceName, gatewayId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayTokenContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GatewayContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, gatewayId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String gatewayId = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, gatewayId, ifMatch, context); + } + + private GatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public GatewayContractImpl define(String name) { + return new GatewayContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GenerateSsoUrlResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GenerateSsoUrlResultImpl.java new file mode 100644 index 0000000000000..802c36c40b720 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GenerateSsoUrlResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.GenerateSsoUrlResultInner; +import com.azure.resourcemanager.apimanagement.models.GenerateSsoUrlResult; + +public final class GenerateSsoUrlResultImpl implements GenerateSsoUrlResult { + private GenerateSsoUrlResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + GenerateSsoUrlResultImpl( + GenerateSsoUrlResultInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String value() { + return this.innerModel().value(); + } + + public GenerateSsoUrlResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupContractImpl.java new file mode 100644 index 0000000000000..b83ff60b18a94 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupContractImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupContract; +import com.azure.resourcemanager.apimanagement.models.GroupCreateParameters; +import com.azure.resourcemanager.apimanagement.models.GroupType; +import com.azure.resourcemanager.apimanagement.models.GroupUpdateParameters; + +public final class GroupContractImpl implements GroupContract, GroupContract.Definition, GroupContract.Update { + private GroupContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean builtIn() { + return this.innerModel().builtIn(); + } + + public GroupType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String externalId() { + return this.innerModel().externalId(); + } + + public GroupContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String groupId; + + private String createIfMatch; + + private GroupCreateParameters createParameters; + + private String updateIfMatch; + + private GroupUpdateParameters updateParameters; + + public GroupContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public GroupContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getGroups() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, groupId, createParameters, createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public GroupContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGroups() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, groupId, createParameters, createIfMatch, context) + .getValue(); + return this; + } + + GroupContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new GroupContractInner(); + this.serviceManager = serviceManager; + this.groupId = name; + this.createIfMatch = null; + this.createParameters = new GroupCreateParameters(); + } + + public GroupContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new GroupUpdateParameters(); + return this; + } + + public GroupContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGroups() + .updateWithResponse( + resourceGroupName, serviceName, groupId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public GroupContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGroups() + .updateWithResponse(resourceGroupName, serviceName, groupId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + GroupContractImpl( + GroupContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.groupId = Utils.getValueFromIdByName(innerObject.id(), "groups"); + } + + public GroupContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGroups() + .getWithResponse(resourceGroupName, serviceName, groupId, Context.NONE) + .getValue(); + return this; + } + + public GroupContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGroups() + .getWithResponse(resourceGroupName, serviceName, groupId, context) + .getValue(); + return this; + } + + public GroupContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.createParameters.withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public GroupContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.createParameters.withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public GroupContractImpl withType(GroupType type) { + if (isInCreateMode()) { + this.createParameters.withType(type); + return this; + } else { + this.updateParameters.withType(type); + return this; + } + } + + public GroupContractImpl withExternalId(String externalId) { + if (isInCreateMode()) { + this.createParameters.withExternalId(externalId); + return this; + } else { + this.updateParameters.withExternalId(externalId); + return this; + } + } + + public GroupContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersClientImpl.java new file mode 100644 index 0000000000000..c56b03d896047 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersClientImpl.java @@ -0,0 +1,1033 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.GroupUsersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.models.UserCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GroupUsersClient. */ +public final class GroupUsersClientImpl implements GroupUsersClient { + private final ClientLogger logger = new ClientLogger(GroupUsersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GroupUsersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of GroupUsersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GroupUsersClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(GroupUsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientGroupUsers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientG") + private interface GroupUsersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}/users") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}/users/{userId}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEntityExists( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}/users/{userId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}/users/{userId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String groupId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String serviceName, + String groupId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String groupId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, groupId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String groupId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, groupId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String serviceName, + String groupId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, groupId, filter, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String groupId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, groupId, filter, top, skip)); + } + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String serviceName, + String groupId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, groupId, filter, top, skip, context)); + } + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, String groupId, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEntityExistsAsync( + String resourceGroupName, String serviceName, String groupId, String userId) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, groupId, userId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkEntityExists(String resourceGroupName, String serviceName, String groupId, String userId) { + Boolean value = checkEntityExistsAsync(resourceGroupName, serviceName, groupId, userId).block(); + if (value != null) { + return value; + } else { + throw logger.logExceptionAsError(new NullPointerException()); + } + } + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, groupId, userId, context).block(); + } + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String serviceName, String groupId, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String serviceName, String groupId, String userId) { + return createWithResponseAsync(resourceGroupName, serviceName, groupId, userId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserContractInner create(String resourceGroupName, String serviceName, String groupId, String userId) { + return createAsync(resourceGroupName, serviceName, groupId, userId).block(); + } + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + return createWithResponseAsync(resourceGroupName, serviceName, groupId, userId, context).block(); + } + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String groupId, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String groupId, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String groupId, String userId) { + return deleteWithResponseAsync(resourceGroupName, serviceName, groupId, userId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String groupId, String userId) { + deleteAsync(resourceGroupName, serviceName, groupId, userId).block(); + } + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, groupId, userId, 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 paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersImpl.java new file mode 100644 index 0000000000000..ca508c906cdd6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupUsersImpl.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.GroupUsersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupUsers; +import com.azure.resourcemanager.apimanagement.models.UserContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GroupUsersImpl implements GroupUsers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupUsersImpl.class); + + private final GroupUsersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public GroupUsersImpl( + GroupUsersClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName, String groupId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, groupId); + return Utils.mapPage(inner, inner1 -> new UserContractImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String serviceName, + String groupId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, groupId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new UserContractImpl(inner1, this.manager())); + } + + public boolean checkEntityExists(String resourceGroupName, String serviceName, String groupId, String userId) { + return this.serviceClient().checkEntityExists(resourceGroupName, serviceName, groupId, userId); + } + + public Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + return this + .serviceClient() + .checkEntityExistsWithResponse(resourceGroupName, serviceName, groupId, userId, context); + } + + public UserContract create(String resourceGroupName, String serviceName, String groupId, String userId) { + UserContractInner inner = this.serviceClient().create(resourceGroupName, serviceName, groupId, userId); + if (inner != null) { + return new UserContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + Response inner = + this.serviceClient().createWithResponse(resourceGroupName, serviceName, groupId, userId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UserContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String groupId, String userId) { + this.serviceClient().delete(resourceGroupName, serviceName, groupId, userId); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, groupId, userId, context); + } + + private GroupUsersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsClientImpl.java new file mode 100644 index 0000000000000..28314ec5a0c0c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsClientImpl.java @@ -0,0 +1,1443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.GroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupCollection; +import com.azure.resourcemanager.apimanagement.models.GroupCreateParameters; +import com.azure.resourcemanager.apimanagement.models.GroupUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.GroupsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.GroupsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.GroupsGetResponse; +import com.azure.resourcemanager.apimanagement.models.GroupsUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GroupsClient. */ +public final class GroupsClientImpl implements GroupsClient { + private final ClientLogger logger = new ClientLogger(GroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GroupsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of GroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GroupsClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(GroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientGroups to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientG") + private interface GroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GroupCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GroupUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/groups/{groupId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("groupId") String groupId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String groupId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, groupId) + .flatMap((GroupsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String groupId) { + getEntityTagAsync(resourceGroupName, serviceName, groupId).block(); + } + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, groupId, context).block(); + } + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String groupId) { + return getWithResponseAsync(resourceGroupName, serviceName, groupId) + .flatMap( + (GroupsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GroupContractInner get(String resourceGroupName, String serviceName, String groupId) { + return getAsync(resourceGroupName, serviceName, groupId).block(); + } + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, groupId, context).block(); + } + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String groupId, + GroupCreateParameters parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String groupId, + GroupCreateParameters parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String groupId, + GroupCreateParameters parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, groupId, parameters, ifMatch) + .flatMap( + (GroupsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String groupId, GroupCreateParameters parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, groupId, parameters, ifMatch) + .flatMap( + (GroupsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GroupContractInner createOrUpdate( + String resourceGroupName, String serviceName, String groupId, GroupCreateParameters parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, groupId, parameters, ifMatch).block(); + } + + /** + * Creates or Updates a group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String groupId, + GroupCreateParameters parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, groupId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String groupId, + String ifMatch, + GroupUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String groupId, + String ifMatch, + GroupUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String groupId, + String ifMatch, + GroupUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, groupId, ifMatch, parameters) + .flatMap( + (GroupsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GroupContractInner update( + String resourceGroupName, + String serviceName, + String groupId, + String ifMatch, + GroupUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, groupId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String groupId, + String ifMatch, + GroupUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, groupId, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String groupId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String groupId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + groupId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String groupId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, groupId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String groupId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, groupId, ifMatch).block(); + } + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, groupId, ifMatch, 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 paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsImpl.java new file mode 100644 index 0000000000000..f9cd2d8e2756c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/GroupsImpl.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.apimanagement.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.apimanagement.fluent.GroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupContract; +import com.azure.resourcemanager.apimanagement.models.Groups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GroupsImpl implements Groups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupsImpl.class); + + private final GroupsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public GroupsImpl( + GroupsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new GroupContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new GroupContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String groupId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, groupId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, groupId, context); + } + + public GroupContract get(String resourceGroupName, String serviceName, String groupId) { + GroupContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, groupId); + if (inner != null) { + return new GroupContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, groupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GroupContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String groupId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, groupId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, groupId, ifMatch, context); + } + + public GroupContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String groupId = Utils.getValueFromIdByName(id, "groups"); + if (groupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, groupId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String groupId = Utils.getValueFromIdByName(id, "groups"); + if (groupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, groupId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String groupId = Utils.getValueFromIdByName(id, "groups"); + if (groupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, groupId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String groupId = Utils.getValueFromIdByName(id, "groups"); + if (groupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'groups'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, groupId, ifMatch, context); + } + + private GroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public GroupContractImpl define(String name) { + return new GroupContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProviderContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProviderContractImpl.java new file mode 100644 index 0000000000000..1293ae14b8af7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProviderContractImpl.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.ClientSecretContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderCreateContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderType; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderUpdateParameters; +import java.util.Collections; +import java.util.List; + +public final class IdentityProviderContractImpl + implements IdentityProviderContract, IdentityProviderContract.Definition, IdentityProviderContract.Update { + private IdentityProviderContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public IdentityProviderType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String signinTenant() { + return this.innerModel().signinTenant(); + } + + public List allowedTenants() { + List inner = this.innerModel().allowedTenants(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String authority() { + return this.innerModel().authority(); + } + + public String signupPolicyName() { + return this.innerModel().signupPolicyName(); + } + + public String signinPolicyName() { + return this.innerModel().signinPolicyName(); + } + + public String profileEditingPolicyName() { + return this.innerModel().profileEditingPolicyName(); + } + + public String passwordResetPolicyName() { + return this.innerModel().passwordResetPolicyName(); + } + + public String clientId() { + return this.innerModel().clientId(); + } + + public String clientSecret() { + return this.innerModel().clientSecret(); + } + + public IdentityProviderContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private IdentityProviderType identityProviderName; + + private String createIfMatch; + + private IdentityProviderCreateContract createParameters; + + private String updateIfMatch; + + private IdentityProviderUpdateParameters updateParameters; + + public IdentityProviderContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public IdentityProviderContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getIdentityProviders() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, identityProviderName, createParameters, createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public IdentityProviderContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIdentityProviders() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, identityProviderName, createParameters, createIfMatch, context) + .getValue(); + return this; + } + + IdentityProviderContractImpl( + IdentityProviderType name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new IdentityProviderContractInner(); + this.serviceManager = serviceManager; + this.identityProviderName = name; + this.createIfMatch = null; + this.createParameters = new IdentityProviderCreateContract(); + } + + public IdentityProviderContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new IdentityProviderUpdateParameters(); + return this; + } + + public IdentityProviderContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIdentityProviders() + .updateWithResponse( + resourceGroupName, serviceName, identityProviderName, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public IdentityProviderContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIdentityProviders() + .updateWithResponse( + resourceGroupName, serviceName, identityProviderName, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + IdentityProviderContractImpl( + IdentityProviderContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.identityProviderName = + IdentityProviderType.fromString(Utils.getValueFromIdByName(innerObject.id(), "identityProviders")); + } + + public IdentityProviderContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIdentityProviders() + .getWithResponse(resourceGroupName, serviceName, identityProviderName, Context.NONE) + .getValue(); + return this; + } + + public IdentityProviderContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIdentityProviders() + .getWithResponse(resourceGroupName, serviceName, identityProviderName, context) + .getValue(); + return this; + } + + public ClientSecretContract listSecrets() { + return serviceManager.identityProviders().listSecrets(resourceGroupName, serviceName, identityProviderName); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager + .identityProviders() + .listSecretsWithResponse(resourceGroupName, serviceName, identityProviderName, context); + } + + public IdentityProviderContractImpl withTypePropertiesType(IdentityProviderType typePropertiesType) { + this.createParameters.withTypePropertiesType(typePropertiesType); + return this; + } + + public IdentityProviderContractImpl withSigninTenant(String signinTenant) { + if (isInCreateMode()) { + this.createParameters.withSigninTenant(signinTenant); + return this; + } else { + this.updateParameters.withSigninTenant(signinTenant); + return this; + } + } + + public IdentityProviderContractImpl withAllowedTenants(List allowedTenants) { + if (isInCreateMode()) { + this.createParameters.withAllowedTenants(allowedTenants); + return this; + } else { + this.updateParameters.withAllowedTenants(allowedTenants); + return this; + } + } + + public IdentityProviderContractImpl withAuthority(String authority) { + if (isInCreateMode()) { + this.createParameters.withAuthority(authority); + return this; + } else { + this.updateParameters.withAuthority(authority); + return this; + } + } + + public IdentityProviderContractImpl withSignupPolicyName(String signupPolicyName) { + if (isInCreateMode()) { + this.createParameters.withSignupPolicyName(signupPolicyName); + return this; + } else { + this.updateParameters.withSignupPolicyName(signupPolicyName); + return this; + } + } + + public IdentityProviderContractImpl withSigninPolicyName(String signinPolicyName) { + if (isInCreateMode()) { + this.createParameters.withSigninPolicyName(signinPolicyName); + return this; + } else { + this.updateParameters.withSigninPolicyName(signinPolicyName); + return this; + } + } + + public IdentityProviderContractImpl withProfileEditingPolicyName(String profileEditingPolicyName) { + if (isInCreateMode()) { + this.createParameters.withProfileEditingPolicyName(profileEditingPolicyName); + return this; + } else { + this.updateParameters.withProfileEditingPolicyName(profileEditingPolicyName); + return this; + } + } + + public IdentityProviderContractImpl withPasswordResetPolicyName(String passwordResetPolicyName) { + if (isInCreateMode()) { + this.createParameters.withPasswordResetPolicyName(passwordResetPolicyName); + return this; + } else { + this.updateParameters.withPasswordResetPolicyName(passwordResetPolicyName); + return this; + } + } + + public IdentityProviderContractImpl withClientId(String clientId) { + if (isInCreateMode()) { + this.createParameters.withClientId(clientId); + return this; + } else { + this.updateParameters.withClientId(clientId); + return this; + } + } + + public IdentityProviderContractImpl withClientSecret(String clientSecret) { + if (isInCreateMode()) { + this.createParameters.withClientSecret(clientSecret); + return this; + } else { + this.updateParameters.withClientSecret(clientSecret); + return this; + } + } + + public IdentityProviderContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public IdentityProviderContractImpl withType(IdentityProviderType type) { + this.updateParameters.withType(type); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersClientImpl.java new file mode 100644 index 0000000000000..57fafb8975aba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersClientImpl.java @@ -0,0 +1,1598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.IdentityProvidersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderCreateContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderList; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderType; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.IdentityProvidersCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.IdentityProvidersGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.IdentityProvidersGetResponse; +import com.azure.resourcemanager.apimanagement.models.IdentityProvidersListSecretsResponse; +import com.azure.resourcemanager.apimanagement.models.IdentityProvidersUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IdentityProvidersClient. */ +public final class IdentityProvidersClientImpl implements IdentityProvidersClient { + private final ClientLogger logger = new ClientLogger(IdentityProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IdentityProvidersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of IdentityProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IdentityProvidersClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(IdentityProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientIdentityProviders to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientI") + private interface IdentityProvidersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders/{identityProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("identityProviderName") IdentityProviderType identityProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders/{identityProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("identityProviderName") IdentityProviderType identityProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders/{identityProviderName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("identityProviderName") IdentityProviderType identityProviderName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IdentityProviderCreateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders/{identityProviderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("identityProviderName") IdentityProviderType identityProviderName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") IdentityProviderUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders/{identityProviderName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("identityProviderName") IdentityProviderType identityProviderName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listSecrets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("identityProviderName") IdentityProviderType identityProviderName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName)); + } + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, context)); + } + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the identityProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the identityProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the identityProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, identityProviderName) + .flatMap((IdentityProvidersGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + getEntityTagAsync(resourceGroupName, serviceName, identityProviderName).block(); + } + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the identityProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, identityProviderName, context).block(); + } + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + return getWithResponseAsync(resourceGroupName, serviceName, identityProviderName) + .flatMap( + (IdentityProvidersGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IdentityProviderContractInner get( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + return getAsync(resourceGroupName, serviceName, identityProviderName).block(); + } + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, identityProviderName, context).block(); + } + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, identityProviderName, parameters, ifMatch) + .flatMap( + (IdentityProvidersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, identityProviderName, parameters, ifMatch) + .flatMap( + (IdentityProvidersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IdentityProviderContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, identityProviderName, parameters, ifMatch).block(); + } + + /** + * Creates or Updates the IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + IdentityProviderCreateContract parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, identityProviderName, parameters, ifMatch, context) + .block(); + } + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, identityProviderName, ifMatch, parameters) + .flatMap( + (IdentityProvidersUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IdentityProviderContractInner update( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, identityProviderName, ifMatch, parameters).block(); + } + + /** + * Updates an existing IdentityProvider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identity Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + IdentityProviderUpdateParameters parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, serviceName, identityProviderName, ifMatch, parameters, context) + .block(); + } + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, IdentityProviderType identityProviderName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, IdentityProviderType identityProviderName, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, identityProviderName, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, IdentityProviderType identityProviderName, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, identityProviderName, ifMatch).block(); + } + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, identityProviderName, ifMatch, context).block(); + } + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (identityProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter identityProviderName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + identityProviderName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, identityProviderName) + .flatMap( + (IdentityProvidersListSecretsResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClientSecretContractInner listSecrets( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + return listSecretsAsync(resourceGroupName, serviceName, identityProviderName).block(); + } + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, identityProviderName, 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 list of all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the Identity Providers configured on the service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersImpl.java new file mode 100644 index 0000000000000..d22e201e541da --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IdentityProvidersImpl.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.IdentityProvidersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.ClientSecretContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderContract; +import com.azure.resourcemanager.apimanagement.models.IdentityProviderType; +import com.azure.resourcemanager.apimanagement.models.IdentityProviders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IdentityProvidersImpl implements IdentityProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProvidersImpl.class); + + private final IdentityProvidersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public IdentityProvidersImpl( + IdentityProvidersClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new IdentityProviderContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new IdentityProviderContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, identityProviderName); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, identityProviderName, context); + } + + public IdentityProviderContract get( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + IdentityProviderContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, identityProviderName); + if (inner != null) { + return new IdentityProviderContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, identityProviderName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IdentityProviderContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, identityProviderName, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, identityProviderName, ifMatch, context); + } + + public ClientSecretContract listSecrets( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName) { + ClientSecretContractInner inner = + this.serviceClient().listSecrets(resourceGroupName, serviceName, identityProviderName); + if (inner != null) { + return new ClientSecretContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, serviceName, identityProviderName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClientSecretContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IdentityProviderContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + IdentityProviderType identityProviderName = + IdentityProviderType.fromString(Utils.getValueFromIdByName(id, "identityProviders")); + if (identityProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'identityProviders'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, identityProviderName, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + IdentityProviderType identityProviderName = + IdentityProviderType.fromString(Utils.getValueFromIdByName(id, "identityProviders")); + if (identityProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'identityProviders'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, identityProviderName, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + IdentityProviderType identityProviderName = + IdentityProviderType.fromString(Utils.getValueFromIdByName(id, "identityProviders")); + if (identityProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'identityProviders'.", id))); + } + String localIfMatch = null; + this + .deleteWithResponse(resourceGroupName, serviceName, identityProviderName, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + IdentityProviderType identityProviderName = + IdentityProviderType.fromString(Utils.getValueFromIdByName(id, "identityProviders")); + if (identityProviderName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'identityProviders'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, identityProviderName, ifMatch, context); + } + + private IdentityProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public IdentityProviderContractImpl define(IdentityProviderType name) { + return new IdentityProviderContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueAttachmentContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueAttachmentContractImpl.java new file mode 100644 index 0000000000000..3406b06258329 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueAttachmentContractImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; +import com.azure.resourcemanager.apimanagement.models.IssueAttachmentContract; + +public final class IssueAttachmentContractImpl + implements IssueAttachmentContract, IssueAttachmentContract.Definition, IssueAttachmentContract.Update { + private IssueAttachmentContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String title() { + return this.innerModel().title(); + } + + public String contentFormat() { + return this.innerModel().contentFormat(); + } + + public String content() { + return this.innerModel().content(); + } + + public IssueAttachmentContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String issueId; + + private String attachmentId; + + private String createIfMatch; + + private String updateIfMatch; + + public IssueAttachmentContractImpl withExistingIssue( + String resourceGroupName, String serviceName, String apiId, String issueId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + this.issueId = issueId; + return this; + } + + public IssueAttachmentContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueAttachments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.innerModel(), + createIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public IssueAttachmentContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueAttachments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.innerModel(), + createIfMatch, + context) + .getValue(); + return this; + } + + IssueAttachmentContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new IssueAttachmentContractInner(); + this.serviceManager = serviceManager; + this.attachmentId = name; + this.createIfMatch = null; + } + + public IssueAttachmentContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public IssueAttachmentContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueAttachments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.innerModel(), + updateIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public IssueAttachmentContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueAttachments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + attachmentId, + this.innerModel(), + updateIfMatch, + context) + .getValue(); + return this; + } + + IssueAttachmentContractImpl( + IssueAttachmentContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.issueId = Utils.getValueFromIdByName(innerObject.id(), "issues"); + this.attachmentId = Utils.getValueFromIdByName(innerObject.id(), "attachments"); + } + + public IssueAttachmentContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueAttachments() + .getWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, Context.NONE) + .getValue(); + return this; + } + + public IssueAttachmentContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueAttachments() + .getWithResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, context) + .getValue(); + return this; + } + + public IssueAttachmentContractImpl withTitle(String title) { + this.innerModel().withTitle(title); + return this; + } + + public IssueAttachmentContractImpl withContentFormat(String contentFormat) { + this.innerModel().withContentFormat(contentFormat); + return this; + } + + public IssueAttachmentContractImpl withContent(String content) { + this.innerModel().withContent(content); + return this; + } + + public IssueAttachmentContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueCommentContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueCommentContractImpl.java new file mode 100644 index 0000000000000..3f6c0e52d975c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueCommentContractImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; +import com.azure.resourcemanager.apimanagement.models.IssueCommentContract; +import java.time.OffsetDateTime; + +public final class IssueCommentContractImpl + implements IssueCommentContract, IssueCommentContract.Definition, IssueCommentContract.Update { + private IssueCommentContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String text() { + return this.innerModel().text(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public String userId() { + return this.innerModel().userId(); + } + + public IssueCommentContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String issueId; + + private String commentId; + + private String createIfMatch; + + private String updateIfMatch; + + public IssueCommentContractImpl withExistingIssue( + String resourceGroupName, String serviceName, String apiId, String issueId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + this.issueId = issueId; + return this; + } + + public IssueCommentContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueComments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.innerModel(), + createIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public IssueCommentContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueComments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.innerModel(), + createIfMatch, + context) + .getValue(); + return this; + } + + IssueCommentContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new IssueCommentContractInner(); + this.serviceManager = serviceManager; + this.commentId = name; + this.createIfMatch = null; + } + + public IssueCommentContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public IssueCommentContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueComments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.innerModel(), + updateIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public IssueCommentContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueComments() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + issueId, + commentId, + this.innerModel(), + updateIfMatch, + context) + .getValue(); + return this; + } + + IssueCommentContractImpl( + IssueCommentContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.issueId = Utils.getValueFromIdByName(innerObject.id(), "issues"); + this.commentId = Utils.getValueFromIdByName(innerObject.id(), "comments"); + } + + public IssueCommentContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueComments() + .getWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, Context.NONE) + .getValue(); + return this; + } + + public IssueCommentContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssueComments() + .getWithResponse(resourceGroupName, serviceName, apiId, issueId, commentId, context) + .getValue(); + return this; + } + + public IssueCommentContractImpl withText(String text) { + this.innerModel().withText(text); + return this; + } + + public IssueCommentContractImpl withCreatedDate(OffsetDateTime createdDate) { + this.innerModel().withCreatedDate(createdDate); + return this; + } + + public IssueCommentContractImpl withUserId(String userId) { + this.innerModel().withUserId(userId); + return this; + } + + public IssueCommentContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueContractImpl.java new file mode 100644 index 0000000000000..b4c94cb4f5808 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssueContractImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.azure.resourcemanager.apimanagement.models.IssueContract; +import com.azure.resourcemanager.apimanagement.models.IssueUpdateContract; +import com.azure.resourcemanager.apimanagement.models.State; +import java.time.OffsetDateTime; + +public final class IssueContractImpl implements IssueContract, IssueContract.Definition, IssueContract.Update { + private IssueContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public State state() { + return this.innerModel().state(); + } + + public String apiId() { + return this.innerModel().apiId(); + } + + public String title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); + } + + public String userId() { + return this.innerModel().userId(); + } + + public IssueContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String issueId; + + private String createIfMatch; + + private String updateIfMatch; + + private IssueUpdateContract updateParameters; + + public IssueContractImpl withExistingApi(String resourceGroupName, String serviceName, String apiId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + return this; + } + + public IssueContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssues() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, issueId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public IssueContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssues() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, issueId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + IssueContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new IssueContractInner(); + this.serviceManager = serviceManager; + this.issueId = name; + this.createIfMatch = null; + } + + public IssueContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new IssueUpdateContract(); + return this; + } + + public IssueContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssues() + .updateWithResponse( + resourceGroupName, serviceName, apiId, issueId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public IssueContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiIssues() + .updateWithResponse( + resourceGroupName, serviceName, apiId, issueId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + IssueContractImpl( + IssueContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.issueId = Utils.getValueFromIdByName(innerObject.id(), "issues"); + } + + public IssueContract refresh() { + Boolean localExpandCommentsAttachments = null; + this.innerObject = + serviceManager + .serviceClient() + .getApiIssues() + .getWithResponse( + resourceGroupName, serviceName, apiId, issueId, localExpandCommentsAttachments, Context.NONE) + .getValue(); + return this; + } + + public IssueContract refresh(Context context) { + Boolean localExpandCommentsAttachments = null; + this.innerObject = + serviceManager + .serviceClient() + .getApiIssues() + .getWithResponse( + resourceGroupName, serviceName, apiId, issueId, localExpandCommentsAttachments, context) + .getValue(); + return this; + } + + public IssueContractImpl withCreatedDate(OffsetDateTime createdDate) { + if (isInCreateMode()) { + this.innerModel().withCreatedDate(createdDate); + return this; + } else { + this.updateParameters.withCreatedDate(createdDate); + return this; + } + } + + public IssueContractImpl withState(State state) { + if (isInCreateMode()) { + this.innerModel().withState(state); + return this; + } else { + this.updateParameters.withState(state); + return this; + } + } + + public IssueContractImpl withApiId(String apiId) { + if (isInCreateMode()) { + this.innerModel().withApiId(apiId); + return this; + } else { + this.updateParameters.withApiId(apiId); + return this; + } + } + + public IssueContractImpl withTitle(String title) { + if (isInCreateMode()) { + this.innerModel().withTitle(title); + return this; + } else { + this.updateParameters.withTitle(title); + return this; + } + } + + public IssueContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public IssueContractImpl withUserId(String userId) { + if (isInCreateMode()) { + this.innerModel().withUserId(userId); + return this; + } else { + this.updateParameters.withUserId(userId); + return this; + } + } + + public IssueContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesClientImpl.java new file mode 100644 index 0000000000000..1dc37741f863a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesClientImpl.java @@ -0,0 +1,593 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.IssuesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.azure.resourcemanager.apimanagement.models.IssueCollection; +import com.azure.resourcemanager.apimanagement.models.IssuesGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IssuesClient. */ +public final class IssuesClientImpl implements IssuesClient { + private final ClientLogger logger = new ClientLogger(IssuesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IssuesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of IssuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IssuesClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(IssuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientIssues to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientI") + private interface IssuesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/issues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/issues/{issueId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("issueId") String issueId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, String issueId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + issueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String issueId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (issueId == null) { + return Mono.error(new IllegalArgumentException("Parameter issueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + issueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String issueId) { + return getWithResponseAsync(resourceGroupName, serviceName, issueId) + .flatMap( + (IssuesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IssueContractInner get(String resourceGroupName, String serviceName, String issueId) { + return getAsync(resourceGroupName, serviceName, issueId).block(); + } + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String issueId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, issueId, 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 paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesImpl.java new file mode 100644 index 0000000000000..024427776e42d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/IssuesImpl.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.apimanagement.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.apimanagement.fluent.IssuesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.azure.resourcemanager.apimanagement.models.IssueContract; +import com.azure.resourcemanager.apimanagement.models.Issues; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IssuesImpl implements Issues { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssuesImpl.class); + + private final IssuesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public IssuesImpl( + IssuesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new IssueContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new IssueContractImpl(inner1, this.manager())); + } + + public IssueContract get(String resourceGroupName, String serviceName, String issueId) { + IssueContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, issueId); + if (inner != null) { + return new IssueContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String issueId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, issueId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IssueContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IssuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggerContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggerContractImpl.java new file mode 100644 index 0000000000000..b99707deeff0f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggerContractImpl.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.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; +import com.azure.resourcemanager.apimanagement.models.LoggerContract; +import com.azure.resourcemanager.apimanagement.models.LoggerType; +import com.azure.resourcemanager.apimanagement.models.LoggerUpdateContract; +import java.util.Collections; +import java.util.Map; + +public final class LoggerContractImpl implements LoggerContract, LoggerContract.Definition, LoggerContract.Update { + private LoggerContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LoggerType loggerType() { + return this.innerModel().loggerType(); + } + + public String description() { + return this.innerModel().description(); + } + + public Map credentials() { + Map inner = this.innerModel().credentials(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Boolean isBuffered() { + return this.innerModel().isBuffered(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public LoggerContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String loggerId; + + private String createIfMatch; + + private String updateIfMatch; + + private LoggerUpdateContract updateParameters; + + public LoggerContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public LoggerContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getLoggers() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, loggerId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public LoggerContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoggers() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, loggerId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + LoggerContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new LoggerContractInner(); + this.serviceManager = serviceManager; + this.loggerId = name; + this.createIfMatch = null; + } + + public LoggerContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new LoggerUpdateContract(); + return this; + } + + public LoggerContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLoggers() + .updateWithResponse( + resourceGroupName, serviceName, loggerId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public LoggerContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoggers() + .updateWithResponse(resourceGroupName, serviceName, loggerId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + LoggerContractImpl( + LoggerContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.loggerId = Utils.getValueFromIdByName(innerObject.id(), "loggers"); + } + + public LoggerContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLoggers() + .getWithResponse(resourceGroupName, serviceName, loggerId, Context.NONE) + .getValue(); + return this; + } + + public LoggerContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLoggers() + .getWithResponse(resourceGroupName, serviceName, loggerId, context) + .getValue(); + return this; + } + + public LoggerContractImpl withLoggerType(LoggerType loggerType) { + if (isInCreateMode()) { + this.innerModel().withLoggerType(loggerType); + return this; + } else { + this.updateParameters.withLoggerType(loggerType); + return this; + } + } + + public LoggerContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public LoggerContractImpl withCredentials(Map credentials) { + if (isInCreateMode()) { + this.innerModel().withCredentials(credentials); + return this; + } else { + this.updateParameters.withCredentials(credentials); + return this; + } + } + + public LoggerContractImpl withIsBuffered(Boolean isBuffered) { + if (isInCreateMode()) { + this.innerModel().withIsBuffered(isBuffered); + return this; + } else { + this.updateParameters.withIsBuffered(isBuffered); + return this; + } + } + + public LoggerContractImpl withResourceId(String resourceId) { + this.innerModel().withResourceId(resourceId); + return this; + } + + public LoggerContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersClientImpl.java new file mode 100644 index 0000000000000..7020d62ce9c86 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersClientImpl.java @@ -0,0 +1,1436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.LoggersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; +import com.azure.resourcemanager.apimanagement.models.LoggerCollection; +import com.azure.resourcemanager.apimanagement.models.LoggerUpdateContract; +import com.azure.resourcemanager.apimanagement.models.LoggersCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.LoggersGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.LoggersGetResponse; +import com.azure.resourcemanager.apimanagement.models.LoggersUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LoggersClient. */ +public final class LoggersClientImpl implements LoggersClient { + private final ClientLogger logger = new ClientLogger(LoggersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LoggersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of LoggersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LoggersClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(LoggersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientLoggers to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientL") + private interface LoggersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/loggers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/loggers/{loggerId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("loggerId") String loggerId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/loggers/{loggerId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("loggerId") String loggerId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/loggers/{loggerId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("loggerId") String loggerId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LoggerContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/loggers/{loggerId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("loggerId") String loggerId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LoggerUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/loggers/{loggerId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("loggerId") String loggerId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String loggerId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String loggerId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String loggerId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, loggerId) + .flatMap((LoggersGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String loggerId) { + getEntityTagAsync(resourceGroupName, serviceName, loggerId).block(); + } + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, loggerId, context).block(); + } + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String loggerId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String loggerId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String loggerId) { + return getWithResponseAsync(resourceGroupName, serviceName, loggerId) + .flatMap( + (LoggersGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoggerContractInner get(String resourceGroupName, String serviceName, String loggerId) { + return getAsync(resourceGroupName, serviceName, loggerId).block(); + } + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, loggerId, context).block(); + } + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String loggerId, LoggerContractInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String loggerId, + LoggerContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String loggerId, LoggerContractInner parameters, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, loggerId, parameters, ifMatch) + .flatMap( + (LoggersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String loggerId, LoggerContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, loggerId, parameters, ifMatch) + .flatMap( + (LoggersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoggerContractInner createOrUpdate( + String resourceGroupName, String serviceName, String loggerId, LoggerContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, loggerId, parameters, ifMatch).block(); + } + + /** + * Creates or Updates a logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String loggerId, + LoggerContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, loggerId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String loggerId, + String ifMatch, + LoggerUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String loggerId, + String ifMatch, + LoggerUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String loggerId, + String ifMatch, + LoggerUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, loggerId, ifMatch, parameters) + .flatMap( + (LoggersUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LoggerContractInner update( + String resourceGroupName, + String serviceName, + String loggerId, + String ifMatch, + LoggerUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, loggerId, ifMatch, parameters).block(); + } + + /** + * Updates an existing logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String loggerId, + String ifMatch, + LoggerUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, loggerId, ifMatch, parameters, context).block(); + } + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String loggerId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String loggerId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (loggerId == null) { + return Mono.error(new IllegalArgumentException("Parameter loggerId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + loggerId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String loggerId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, loggerId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String loggerId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, loggerId, ifMatch).block(); + } + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String loggerId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, loggerId, ifMatch, 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 paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersImpl.java new file mode 100644 index 0000000000000..42c74e352ee9e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/LoggersImpl.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.apimanagement.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.apimanagement.fluent.LoggersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; +import com.azure.resourcemanager.apimanagement.models.LoggerContract; +import com.azure.resourcemanager.apimanagement.models.Loggers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LoggersImpl implements Loggers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggersImpl.class); + + private final LoggersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public LoggersImpl( + LoggersClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new LoggerContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new LoggerContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String loggerId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, loggerId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, loggerId, context); + } + + public LoggerContract get(String resourceGroupName, String serviceName, String loggerId) { + LoggerContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, loggerId); + if (inner != null) { + return new LoggerContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, loggerId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LoggerContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String loggerId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, loggerId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String loggerId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, loggerId, ifMatch, context); + } + + public LoggerContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String loggerId = Utils.getValueFromIdByName(id, "loggers"); + if (loggerId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loggers'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, loggerId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String loggerId = Utils.getValueFromIdByName(id, "loggers"); + if (loggerId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loggers'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, loggerId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String loggerId = Utils.getValueFromIdByName(id, "loggers"); + if (loggerId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loggers'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, loggerId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String loggerId = Utils.getValueFromIdByName(id, "loggers"); + if (loggerId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'loggers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, loggerId, ifMatch, context); + } + + private LoggersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public LoggerContractImpl define(String name) { + return new LoggerContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueContractImpl.java new file mode 100644 index 0000000000000..f648b1c3b178a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueContractImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; +import com.azure.resourcemanager.apimanagement.models.KeyVaultContractCreateProperties; +import com.azure.resourcemanager.apimanagement.models.KeyVaultContractProperties; +import com.azure.resourcemanager.apimanagement.models.NamedValueContract; +import com.azure.resourcemanager.apimanagement.models.NamedValueCreateContract; +import com.azure.resourcemanager.apimanagement.models.NamedValueSecretContract; +import com.azure.resourcemanager.apimanagement.models.NamedValueUpdateParameters; +import java.util.Collections; +import java.util.List; + +public final class NamedValueContractImpl + implements NamedValueContract, NamedValueContract.Definition, NamedValueContract.Update { + private NamedValueContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List tags() { + List inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean secret() { + return this.innerModel().secret(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String value() { + return this.innerModel().value(); + } + + public KeyVaultContractProperties keyVault() { + return this.innerModel().keyVault(); + } + + public NamedValueContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String namedValueId; + + private String createIfMatch; + + private NamedValueCreateContract createParameters; + + private String updateIfMatch; + + private NamedValueUpdateParameters updateParameters; + + public NamedValueContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public NamedValueContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getNamedValues() + .createOrUpdate( + resourceGroupName, serviceName, namedValueId, createParameters, createIfMatch, Context.NONE); + return this; + } + + public NamedValueContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamedValues() + .createOrUpdate(resourceGroupName, serviceName, namedValueId, createParameters, createIfMatch, context); + return this; + } + + NamedValueContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new NamedValueContractInner(); + this.serviceManager = serviceManager; + this.namedValueId = name; + this.createIfMatch = null; + this.createParameters = new NamedValueCreateContract(); + } + + public NamedValueContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new NamedValueUpdateParameters(); + return this; + } + + public NamedValueContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNamedValues() + .update(resourceGroupName, serviceName, namedValueId, updateIfMatch, updateParameters, Context.NONE); + return this; + } + + public NamedValueContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamedValues() + .update(resourceGroupName, serviceName, namedValueId, updateIfMatch, updateParameters, context); + return this; + } + + NamedValueContractImpl( + NamedValueContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.namedValueId = Utils.getValueFromIdByName(innerObject.id(), "namedValues"); + } + + public NamedValueContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNamedValues() + .getWithResponse(resourceGroupName, serviceName, namedValueId, Context.NONE) + .getValue(); + return this; + } + + public NamedValueContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNamedValues() + .getWithResponse(resourceGroupName, serviceName, namedValueId, context) + .getValue(); + return this; + } + + public NamedValueSecretContract listValue() { + return serviceManager.namedValues().listValue(resourceGroupName, serviceName, namedValueId); + } + + public Response listValueWithResponse(Context context) { + return serviceManager + .namedValues() + .listValueWithResponse(resourceGroupName, serviceName, namedValueId, context); + } + + public NamedValueContract refreshSecret() { + return serviceManager.namedValues().refreshSecret(resourceGroupName, serviceName, namedValueId); + } + + public NamedValueContract refreshSecret(Context context) { + return serviceManager.namedValues().refreshSecret(resourceGroupName, serviceName, namedValueId, context); + } + + public NamedValueContractImpl withTags(List tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NamedValueContractImpl withSecret(Boolean secret) { + if (isInCreateMode()) { + this.createParameters.withSecret(secret); + return this; + } else { + this.updateParameters.withSecret(secret); + return this; + } + } + + public NamedValueContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.createParameters.withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public NamedValueContractImpl withValue(String value) { + if (isInCreateMode()) { + this.createParameters.withValue(value); + return this; + } else { + this.updateParameters.withValue(value); + return this; + } + } + + public NamedValueContractImpl withKeyVault(KeyVaultContractCreateProperties keyVault) { + if (isInCreateMode()) { + this.createParameters.withKeyVault(keyVault); + return this; + } else { + this.updateParameters.withKeyVault(keyVault); + return this; + } + } + + public NamedValueContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueSecretContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueSecretContractImpl.java new file mode 100644 index 0000000000000..8eb29418c4063 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValueSecretContractImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner; +import com.azure.resourcemanager.apimanagement.models.NamedValueSecretContract; + +public final class NamedValueSecretContractImpl implements NamedValueSecretContract { + private NamedValueSecretContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + NamedValueSecretContractImpl( + NamedValueSecretContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String value() { + return this.innerModel().value(); + } + + public NamedValueSecretContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesClientImpl.java new file mode 100644 index 0000000000000..8dbc962399074 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesClientImpl.java @@ -0,0 +1,2255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.apimanagement.fluent.NamedValuesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner; +import com.azure.resourcemanager.apimanagement.models.NamedValueCollection; +import com.azure.resourcemanager.apimanagement.models.NamedValueCreateContract; +import com.azure.resourcemanager.apimanagement.models.NamedValueUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.NamedValuesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.NamedValuesGetResponse; +import com.azure.resourcemanager.apimanagement.models.NamedValuesListValueResponse; +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 NamedValuesClient. */ +public final class NamedValuesClientImpl implements NamedValuesClient { + private final ClientLogger logger = new ClientLogger(NamedValuesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NamedValuesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of NamedValuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NamedValuesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(NamedValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientNamedValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientN") + private interface NamedValuesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("isKeyVaultRefreshFailed") Boolean isKeyVaultRefreshFailed, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NamedValueCreateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NamedValueUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}/listValue") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listValue( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/namedValues/{namedValueId}/refreshSecret") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshSecret( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("namedValueId") String namedValueId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + isKeyVaultRefreshFailed, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + isKeyVaultRefreshFailed, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean isKeyVaultRefreshFailed = null; + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean isKeyVaultRefreshFailed = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed)); + } + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed, context)); + } + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String namedValueId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, namedValueId) + .flatMap((NamedValuesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String namedValueId) { + getEntityTagAsync(resourceGroupName, serviceName, namedValueId).block(); + } + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, namedValueId, context).block(); + } + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String namedValueId) { + return getWithResponseAsync(resourceGroupName, serviceName, namedValueId) + .flatMap( + (NamedValuesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner get(String resourceGroupName, String serviceName, String namedValueId) { + return getAsync(resourceGroupName, serviceName, namedValueId).block(); + } + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, namedValueId, context).block(); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NamedValueContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NamedValueContractInner.class, + NamedValueContractInner.class, + Context.NONE); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NamedValueContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NamedValueContractInner.class, + NamedValueContractInner.class, + context); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NamedValueContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch) + .getSyncPoller(); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NamedValueContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, context) + .getSyncPoller(); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String namedValueId, NamedValueCreateContract parameters) { + final String ifMatch = null; + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch) { + return createOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch).block(); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner createOrUpdate( + String resourceGroupName, String serviceName, String namedValueId, NamedValueCreateContract parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch).block(); + } + + /** + * Creates or updates named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + NamedValueCreateContract parameters, + String ifMatch, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, context).block(); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NamedValueContractInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NamedValueContractInner.class, + NamedValueContractInner.class, + Context.NONE); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NamedValueContractInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NamedValueContractInner.class, + NamedValueContractInner.class, + context); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NamedValueContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters).getSyncPoller(); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NamedValueContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner update( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters).block(); + } + + /** + * Updates the specific named value. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner update( + String resourceGroupName, + String serviceName, + String namedValueId, + String ifMatch, + NamedValueUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, serviceName, namedValueId, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String namedValueId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String namedValueId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String namedValueId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, namedValueId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String namedValueId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, namedValueId, ifMatch).block(); + } + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String namedValueId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, namedValueId, ifMatch, context).block(); + } + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listValueWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listValue( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listValueWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listValue( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listValueAsync( + String resourceGroupName, String serviceName, String namedValueId) { + return listValueWithResponseAsync(resourceGroupName, serviceName, namedValueId) + .flatMap( + (NamedValuesListValueResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueSecretContractInner listValue(String resourceGroupName, String serviceName, String namedValueId) { + return listValueAsync(resourceGroupName, serviceName, namedValueId).block(); + } + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listValueWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return listValueWithResponseAsync(resourceGroupName, serviceName, namedValueId, context).block(); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshSecretWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refreshSecret( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshSecretWithResponseAsync( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (namedValueId == null) { + return Mono.error(new IllegalArgumentException("Parameter namedValueId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refreshSecret( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + namedValueId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NamedValueContractInner> beginRefreshSecretAsync( + String resourceGroupName, String serviceName, String namedValueId) { + Mono>> mono = + refreshSecretWithResponseAsync(resourceGroupName, serviceName, namedValueId); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NamedValueContractInner.class, + NamedValueContractInner.class, + Context.NONE); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NamedValueContractInner> beginRefreshSecretAsync( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + refreshSecretWithResponseAsync(resourceGroupName, serviceName, namedValueId, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NamedValueContractInner.class, + NamedValueContractInner.class, + context); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NamedValueContractInner> beginRefreshSecret( + String resourceGroupName, String serviceName, String namedValueId) { + return beginRefreshSecretAsync(resourceGroupName, serviceName, namedValueId).getSyncPoller(); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NamedValueContractInner> beginRefreshSecret( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return beginRefreshSecretAsync(resourceGroupName, serviceName, namedValueId, context).getSyncPoller(); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshSecretAsync( + String resourceGroupName, String serviceName, String namedValueId) { + return beginRefreshSecretAsync(resourceGroupName, serviceName, namedValueId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshSecretAsync( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return beginRefreshSecretAsync(resourceGroupName, serviceName, namedValueId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner refreshSecret(String resourceGroupName, String serviceName, String namedValueId) { + return refreshSecretAsync(resourceGroupName, serviceName, namedValueId).block(); + } + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamedValueContractInner refreshSecret( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return refreshSecretAsync(resourceGroupName, serviceName, namedValueId, 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 paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesImpl.java new file mode 100644 index 0000000000000..97f05a9af18ee --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NamedValuesImpl.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.NamedValuesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner; +import com.azure.resourcemanager.apimanagement.models.NamedValueContract; +import com.azure.resourcemanager.apimanagement.models.NamedValueSecretContract; +import com.azure.resourcemanager.apimanagement.models.NamedValues; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NamedValuesImpl implements NamedValues { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesImpl.class); + + private final NamedValuesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public NamedValuesImpl( + NamedValuesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new NamedValueContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, filter, top, skip, isKeyVaultRefreshFailed, context); + return Utils.mapPage(inner, inner1 -> new NamedValueContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String namedValueId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, namedValueId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, namedValueId, context); + } + + public NamedValueContract get(String resourceGroupName, String serviceName, String namedValueId) { + NamedValueContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, namedValueId); + if (inner != null) { + return new NamedValueContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, namedValueId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NamedValueContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String namedValueId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, namedValueId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String namedValueId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, namedValueId, ifMatch, context); + } + + public NamedValueSecretContract listValue(String resourceGroupName, String serviceName, String namedValueId) { + NamedValueSecretContractInner inner = + this.serviceClient().listValue(resourceGroupName, serviceName, namedValueId); + if (inner != null) { + return new NamedValueSecretContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listValueWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + Response inner = + this.serviceClient().listValueWithResponse(resourceGroupName, serviceName, namedValueId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NamedValueSecretContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NamedValueContract refreshSecret(String resourceGroupName, String serviceName, String namedValueId) { + NamedValueContractInner inner = + this.serviceClient().refreshSecret(resourceGroupName, serviceName, namedValueId); + if (inner != null) { + return new NamedValueContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public NamedValueContract refreshSecret( + String resourceGroupName, String serviceName, String namedValueId, Context context) { + NamedValueContractInner inner = + this.serviceClient().refreshSecret(resourceGroupName, serviceName, namedValueId, context); + if (inner != null) { + return new NamedValueContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public NamedValueContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String namedValueId = Utils.getValueFromIdByName(id, "namedValues"); + if (namedValueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namedValues'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, namedValueId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String namedValueId = Utils.getValueFromIdByName(id, "namedValues"); + if (namedValueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namedValues'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, namedValueId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String namedValueId = Utils.getValueFromIdByName(id, "namedValues"); + if (namedValueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namedValues'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, namedValueId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String namedValueId = Utils.getValueFromIdByName(id, "namedValues"); + if (namedValueId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'namedValues'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, namedValueId, ifMatch, context); + } + + private NamedValuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public NamedValueContractImpl define(String name) { + return new NamedValueContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusClientImpl.java new file mode 100644 index 0000000000000..53d6076ee209b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusClientImpl.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.NetworkStatusClient; +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractByLocationInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkStatusClient. */ +public final class NetworkStatusClientImpl implements NetworkStatusClient { + private final ClientLogger logger = new ClientLogger(NetworkStatusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NetworkStatusService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of NetworkStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkStatusClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(NetworkStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientNetworkStatus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientN") + private interface NetworkStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/networkstatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listByService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/locations/{locationName}/networkstatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("locationName") String locationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceAsync( + String resourceGroupName, String serviceName) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listByService(String resourceGroupName, String serviceName) { + return listByServiceAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationWithResponseAsync( + String resourceGroupName, String serviceName, String locationName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + locationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationWithResponseAsync( + String resourceGroupName, String serviceName, String locationName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + locationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByLocationAsync( + String resourceGroupName, String serviceName, String locationName) { + return listByLocationWithResponseAsync(resourceGroupName, serviceName, locationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkStatusContractInner listByLocation( + String resourceGroupName, String serviceName, String locationName) { + return listByLocationAsync(resourceGroupName, serviceName, locationName).block(); + } + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByLocationWithResponse( + String resourceGroupName, String serviceName, String locationName, Context context) { + return listByLocationWithResponseAsync(resourceGroupName, serviceName, locationName, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractByLocationImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractByLocationImpl.java new file mode 100644 index 0000000000000..cbbada84e83f5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractByLocationImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractByLocationInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner; +import com.azure.resourcemanager.apimanagement.models.NetworkStatusContract; +import com.azure.resourcemanager.apimanagement.models.NetworkStatusContractByLocation; + +public final class NetworkStatusContractByLocationImpl implements NetworkStatusContractByLocation { + private NetworkStatusContractByLocationInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + NetworkStatusContractByLocationImpl( + NetworkStatusContractByLocationInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String location() { + return this.innerModel().location(); + } + + public NetworkStatusContract networkStatus() { + NetworkStatusContractInner inner = this.innerModel().networkStatus(); + if (inner != null) { + return new NetworkStatusContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkStatusContractByLocationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractImpl.java new file mode 100644 index 0000000000000..40cbde1c6437b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner; +import com.azure.resourcemanager.apimanagement.models.ConnectivityStatusContract; +import com.azure.resourcemanager.apimanagement.models.NetworkStatusContract; +import java.util.Collections; +import java.util.List; + +public final class NetworkStatusContractImpl implements NetworkStatusContract { + private NetworkStatusContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + NetworkStatusContractImpl( + NetworkStatusContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List dnsServers() { + List inner = this.innerModel().dnsServers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List connectivityStatus() { + List inner = this.innerModel().connectivityStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkStatusContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusImpl.java new file mode 100644 index 0000000000000..9c32c35b5d924 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NetworkStatusImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.NetworkStatusClient; +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractByLocationInner; +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner; +import com.azure.resourcemanager.apimanagement.models.NetworkStatus; +import com.azure.resourcemanager.apimanagement.models.NetworkStatusContract; +import com.azure.resourcemanager.apimanagement.models.NetworkStatusContractByLocation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkStatusImpl implements NetworkStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkStatusImpl.class); + + private final NetworkStatusClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public NetworkStatusImpl( + NetworkStatusClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List listByService(String resourceGroupName, String serviceName) { + List inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new NetworkStatusContractByLocationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response> inner = + this.serviceClient().listByServiceWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new NetworkStatusContractByLocationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public NetworkStatusContract listByLocation(String resourceGroupName, String serviceName, String locationName) { + NetworkStatusContractInner inner = + this.serviceClient().listByLocation(resourceGroupName, serviceName, locationName); + if (inner != null) { + return new NetworkStatusContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByLocationWithResponse( + String resourceGroupName, String serviceName, String locationName, Context context) { + Response inner = + this.serviceClient().listByLocationWithResponse(resourceGroupName, serviceName, locationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkStatusContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private NetworkStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationContractImpl.java new file mode 100644 index 0000000000000..038c4e9d129db --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationContract; +import com.azure.resourcemanager.apimanagement.models.RecipientsContractProperties; + +public final class NotificationContractImpl implements NotificationContract { + private NotificationContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + NotificationContractImpl( + NotificationContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); + } + + public RecipientsContractProperties recipients() { + return this.innerModel().recipients(); + } + + public NotificationContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsClientImpl.java new file mode 100644 index 0000000000000..50ac57f4b3c88 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsClientImpl.java @@ -0,0 +1,856 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.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.apimanagement.fluent.NotificationRecipientEmailsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NotificationRecipientEmailsClient. */ +public final class NotificationRecipientEmailsClientImpl implements NotificationRecipientEmailsClient { + private final ClientLogger logger = new ClientLogger(NotificationRecipientEmailsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NotificationRecipientEmailsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of NotificationRecipientEmailsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NotificationRecipientEmailsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create( + NotificationRecipientEmailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientNotificationRecipientEmails to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientN") + private interface NotificationRecipientEmailsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientEmails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNotification( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEntityExists( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @PathParam("email") String email, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @PathParam("email") String email, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @PathParam("email") String email, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNotificationWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByNotification( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNotificationWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNotification( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByNotificationAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + return listByNotificationWithResponseAsync(resourceGroupName, serviceName, notificationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecipientEmailCollectionInner listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName) { + return listByNotificationAsync(resourceGroupName, serviceName, notificationName).block(); + } + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + return listByNotificationWithResponseAsync(resourceGroupName, serviceName, notificationName, context).block(); + } + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (email == null) { + return Mono.error(new IllegalArgumentException("Parameter email is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + email, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEntityExistsWithResponseAsync( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (email == null) { + return Mono.error(new IllegalArgumentException("Parameter email is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + email, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEntityExistsAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, notificationName, email) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + Boolean value = checkEntityExistsAsync(resourceGroupName, serviceName, notificationName, email).block(); + if (value != null) { + return value; + } else { + throw logger.logExceptionAsError(new NullPointerException()); + } + } + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEntityExistsWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, notificationName, email, context) + .block(); + } + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (email == null) { + return Mono.error(new IllegalArgumentException("Parameter email is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + email, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (email == null) { + return Mono.error(new IllegalArgumentException("Parameter email is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + email, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, email) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecipientEmailContractInner createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + return createOrUpdateAsync(resourceGroupName, serviceName, notificationName, email).block(); + } + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, email, context) + .block(); + } + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, NotificationName notificationName, String email) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (email == null) { + return Mono.error(new IllegalArgumentException("Parameter email is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + email, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + NotificationName notificationName, + String email, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (email == null) { + return Mono.error(new IllegalArgumentException("Parameter email is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + email, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, NotificationName notificationName, String email) { + return deleteWithResponseAsync(resourceGroupName, serviceName, notificationName, email) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, NotificationName notificationName, String email) { + deleteAsync(resourceGroupName, serviceName, notificationName, email).block(); + } + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, notificationName, email, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsImpl.java new file mode 100644 index 0000000000000..e29839cbe5f68 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientEmailsImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.NotificationRecipientEmailsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; +import com.azure.resourcemanager.apimanagement.models.NotificationRecipientEmails; +import com.azure.resourcemanager.apimanagement.models.RecipientEmailCollection; +import com.azure.resourcemanager.apimanagement.models.RecipientEmailContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NotificationRecipientEmailsImpl implements NotificationRecipientEmails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationRecipientEmailsImpl.class); + + private final NotificationRecipientEmailsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public NotificationRecipientEmailsImpl( + NotificationRecipientEmailsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public RecipientEmailCollection listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName) { + RecipientEmailCollectionInner inner = + this.serviceClient().listByNotification(resourceGroupName, serviceName, notificationName); + if (inner != null) { + return new RecipientEmailCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + Response inner = + this + .serviceClient() + .listByNotificationWithResponse(resourceGroupName, serviceName, notificationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecipientEmailCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + return this.serviceClient().checkEntityExists(resourceGroupName, serviceName, notificationName, email); + } + + public Response checkEntityExistsWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + return this + .serviceClient() + .checkEntityExistsWithResponse(resourceGroupName, serviceName, notificationName, email, context); + } + + public RecipientEmailContract createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + RecipientEmailContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, notificationName, email); + if (inner != null) { + return new RecipientEmailContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, notificationName, email, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecipientEmailContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, NotificationName notificationName, String email) { + this.serviceClient().delete(resourceGroupName, serviceName, notificationName, email); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String email, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, notificationName, email, context); + } + + private NotificationRecipientEmailsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersClientImpl.java new file mode 100644 index 0000000000000..0d291949addc1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersClientImpl.java @@ -0,0 +1,856 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.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.apimanagement.fluent.NotificationRecipientUsersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NotificationRecipientUsersClient. */ +public final class NotificationRecipientUsersClientImpl implements NotificationRecipientUsersClient { + private final ClientLogger logger = new ClientLogger(NotificationRecipientUsersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NotificationRecipientUsersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of NotificationRecipientUsersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NotificationRecipientUsersClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create( + NotificationRecipientUsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientNotificationRecipientUsers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientN") + private interface NotificationRecipientUsersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientUsers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByNotification( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEntityExists( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNotificationWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByNotification( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByNotificationWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByNotification( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByNotificationAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + return listByNotificationWithResponseAsync(resourceGroupName, serviceName, notificationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecipientUserCollectionInner listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName) { + return listByNotificationAsync(resourceGroupName, serviceName, notificationName).block(); + } + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + return listByNotificationWithResponseAsync(resourceGroupName, serviceName, notificationName, context).block(); + } + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEntityExistsWithResponseAsync( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEntityExistsAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, notificationName, userId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + Boolean value = checkEntityExistsAsync(resourceGroupName, serviceName, notificationName, userId).block(); + if (value != null) { + return value; + } else { + throw logger.logExceptionAsError(new NullPointerException()); + } + } + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEntityExistsWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, notificationName, userId, context) + .block(); + } + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, userId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecipientUserContractInner createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + return createOrUpdateAsync(resourceGroupName, serviceName, notificationName, userId).block(); + } + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, userId, context) + .block(); + } + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, NotificationName notificationName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + NotificationName notificationName, + String userId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, NotificationName notificationName, String userId) { + return deleteWithResponseAsync(resourceGroupName, serviceName, notificationName, userId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, NotificationName notificationName, String userId) { + deleteAsync(resourceGroupName, serviceName, notificationName, userId).block(); + } + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, notificationName, userId, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersImpl.java new file mode 100644 index 0000000000000..2e2021eed687f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationRecipientUsersImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.NotificationRecipientUsersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationName; +import com.azure.resourcemanager.apimanagement.models.NotificationRecipientUsers; +import com.azure.resourcemanager.apimanagement.models.RecipientUserCollection; +import com.azure.resourcemanager.apimanagement.models.RecipientUserContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NotificationRecipientUsersImpl implements NotificationRecipientUsers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationRecipientUsersImpl.class); + + private final NotificationRecipientUsersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public NotificationRecipientUsersImpl( + NotificationRecipientUsersClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public RecipientUserCollection listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName) { + RecipientUserCollectionInner inner = + this.serviceClient().listByNotification(resourceGroupName, serviceName, notificationName); + if (inner != null) { + return new RecipientUserCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + Response inner = + this + .serviceClient() + .listByNotificationWithResponse(resourceGroupName, serviceName, notificationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecipientUserCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + return this.serviceClient().checkEntityExists(resourceGroupName, serviceName, notificationName, userId); + } + + public Response checkEntityExistsWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + return this + .serviceClient() + .checkEntityExistsWithResponse(resourceGroupName, serviceName, notificationName, userId, context); + } + + public RecipientUserContract createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + RecipientUserContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, notificationName, userId); + if (inner != null) { + return new RecipientUserContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, notificationName, userId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecipientUserContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, NotificationName notificationName, String userId) { + this.serviceClient().delete(resourceGroupName, serviceName, notificationName, userId); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, notificationName, userId, context); + } + + private NotificationRecipientUsersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsClientImpl.java new file mode 100644 index 0000000000000..378b6cb631fc0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsClientImpl.java @@ -0,0 +1,786 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.NotificationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationCollection; +import com.azure.resourcemanager.apimanagement.models.NotificationName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NotificationsClient. */ +public final class NotificationsClientImpl implements NotificationsClient { + private final ClientLogger logger = new ClientLogger(NotificationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NotificationsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of NotificationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NotificationsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(NotificationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientNotifications to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientN") + private interface NotificationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/notifications/{notificationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("notificationName") NotificationName notificationName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, top, skip)); + } + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, top, skip, context)); + } + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + return getWithResponseAsync(resourceGroupName, serviceName, notificationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationContractInner get( + String resourceGroupName, String serviceName, NotificationName notificationName) { + return getAsync(resourceGroupName, serviceName, notificationName).block(); + } + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, notificationName, context).block(); + } + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (notificationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter notificationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + notificationName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, NotificationName notificationName, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, NotificationName notificationName) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationContractInner createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, notificationName, ifMatch).block(); + } + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, notificationName, ifMatch, 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 paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsImpl.java new file mode 100644 index 0000000000000..4dc4570352357 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/NotificationsImpl.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.NotificationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner; +import com.azure.resourcemanager.apimanagement.models.NotificationContract; +import com.azure.resourcemanager.apimanagement.models.NotificationName; +import com.azure.resourcemanager.apimanagement.models.Notifications; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NotificationsImpl implements Notifications { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationsImpl.class); + + private final NotificationsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public NotificationsImpl( + NotificationsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new NotificationContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, top, skip, context); + return Utils.mapPage(inner, inner1 -> new NotificationContractImpl(inner1, this.manager())); + } + + public NotificationContract get(String resourceGroupName, String serviceName, NotificationName notificationName) { + NotificationContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, notificationName); + if (inner != null) { + return new NotificationContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, notificationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NotificationContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NotificationContract createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName) { + NotificationContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, notificationName); + if (inner != null) { + return new NotificationContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, notificationName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NotificationContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private NotificationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersClientImpl.java new file mode 100644 index 0000000000000..aecaadb36b499 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersClientImpl.java @@ -0,0 +1,1626 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.OpenIdConnectProvidersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProviderCollection; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProvidersCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProvidersGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProvidersGetResponse; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProvidersListSecretsResponse; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProvidersUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderUpdateContract; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OpenIdConnectProvidersClient. */ +public final class OpenIdConnectProvidersClientImpl implements OpenIdConnectProvidersClient { + private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OpenIdConnectProvidersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of OpenIdConnectProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OpenIdConnectProvidersClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(OpenIdConnectProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientOpenIdConnectProviders to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientO") + private interface OpenIdConnectProvidersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders/{opid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("opid") String opid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders/{opid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("opid") String opid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders/{opid}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("opid") String opid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OpenidConnectProviderContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders/{opid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("opid") String opid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") OpenidConnectProviderUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders/{opid}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("opid") String opid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/openidConnectProviders/{opid}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listSecrets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("opid") String opid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String opid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String opid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String opid) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, opid) + .flatMap((OpenIdConnectProvidersGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String opid) { + getEntityTagAsync(resourceGroupName, serviceName, opid).block(); + } + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String opid, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, opid, context).block(); + } + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String opid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String opid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String opid) { + return getWithResponseAsync(resourceGroupName, serviceName, opid) + .flatMap( + (OpenIdConnectProvidersGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenidConnectProviderContractInner get(String resourceGroupName, String serviceName, String opid) { + return getAsync(resourceGroupName, serviceName, opid).block(); + } + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String opid, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, opid, context).block(); + } + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String opid, + OpenidConnectProviderContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String opid, + OpenidConnectProviderContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String opid, + OpenidConnectProviderContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, opid, parameters, ifMatch) + .flatMap( + (OpenIdConnectProvidersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String opid, OpenidConnectProviderContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, opid, parameters, ifMatch) + .flatMap( + (OpenIdConnectProvidersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenidConnectProviderContractInner createOrUpdate( + String resourceGroupName, String serviceName, String opid, OpenidConnectProviderContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, opid, parameters, ifMatch).block(); + } + + /** + * Creates or updates the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String opid, + OpenidConnectProviderContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, opid, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, opid, ifMatch, parameters) + .flatMap( + (OpenIdConnectProvidersUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenidConnectProviderContractInner update( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, opid, ifMatch, parameters).block(); + } + + /** + * Updates the specific OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return openId Connect Provider details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String opid, + String ifMatch, + OpenidConnectProviderUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, opid, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String opid, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String opid, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String opid, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, opid, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String opid, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, opid, ifMatch).block(); + } + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String opid, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, opid, ifMatch, context).block(); + } + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String opid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String opid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (opid == null) { + return Mono.error(new IllegalArgumentException("Parameter opid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + opid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String serviceName, String opid) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, opid) + .flatMap( + (OpenIdConnectProvidersListSecretsResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClientSecretContractInner listSecrets(String resourceGroupName, String serviceName, String opid) { + return listSecretsAsync(resourceGroupName, serviceName, opid).block(); + } + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String opid, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, opid, 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 paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersImpl.java new file mode 100644 index 0000000000000..71ee44d065f69 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.OpenIdConnectProvidersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.ClientSecretContract; +import com.azure.resourcemanager.apimanagement.models.OpenIdConnectProviders; +import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OpenIdConnectProvidersImpl implements OpenIdConnectProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersImpl.class); + + private final OpenIdConnectProvidersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public OpenIdConnectProvidersImpl( + OpenIdConnectProvidersClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new OpenidConnectProviderContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new OpenidConnectProviderContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String opid) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, opid); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String opid, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, opid, context); + } + + public OpenidConnectProviderContract get(String resourceGroupName, String serviceName, String opid) { + OpenidConnectProviderContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, opid); + if (inner != null) { + return new OpenidConnectProviderContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String opid, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, opid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OpenidConnectProviderContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String opid, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, opid, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String opid, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, opid, ifMatch, context); + } + + public ClientSecretContract listSecrets(String resourceGroupName, String serviceName, String opid) { + ClientSecretContractInner inner = this.serviceClient().listSecrets(resourceGroupName, serviceName, opid); + if (inner != null) { + return new ClientSecretContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String opid, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, serviceName, opid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClientSecretContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OpenidConnectProviderContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String opid = Utils.getValueFromIdByName(id, "openidConnectProviders"); + if (opid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openidConnectProviders'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, opid, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String opid = Utils.getValueFromIdByName(id, "openidConnectProviders"); + if (opid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openidConnectProviders'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, opid, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String opid = Utils.getValueFromIdByName(id, "openidConnectProviders"); + if (opid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openidConnectProviders'.", + id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, opid, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String opid = Utils.getValueFromIdByName(id, "openidConnectProviders"); + if (opid == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openidConnectProviders'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, opid, ifMatch, context); + } + + private OpenIdConnectProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public OpenidConnectProviderContractImpl define(String name) { + return new OpenidConnectProviderContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenidConnectProviderContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenidConnectProviderContractImpl.java new file mode 100644 index 0000000000000..8124d923b502d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenidConnectProviderContractImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; +import com.azure.resourcemanager.apimanagement.models.ClientSecretContract; +import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderContract; +import com.azure.resourcemanager.apimanagement.models.OpenidConnectProviderUpdateContract; + +public final class OpenidConnectProviderContractImpl + implements OpenidConnectProviderContract, + OpenidConnectProviderContract.Definition, + OpenidConnectProviderContract.Update { + private OpenidConnectProviderContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String metadataEndpoint() { + return this.innerModel().metadataEndpoint(); + } + + public String clientId() { + return this.innerModel().clientId(); + } + + public String clientSecret() { + return this.innerModel().clientSecret(); + } + + public OpenidConnectProviderContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String opid; + + private String createIfMatch; + + private String updateIfMatch; + + private OpenidConnectProviderUpdateContract updateParameters; + + public OpenidConnectProviderContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public OpenidConnectProviderContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getOpenIdConnectProviders() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, opid, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public OpenidConnectProviderContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOpenIdConnectProviders() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, opid, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + OpenidConnectProviderContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new OpenidConnectProviderContractInner(); + this.serviceManager = serviceManager; + this.opid = name; + this.createIfMatch = null; + } + + public OpenidConnectProviderContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new OpenidConnectProviderUpdateContract(); + return this; + } + + public OpenidConnectProviderContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getOpenIdConnectProviders() + .updateWithResponse(resourceGroupName, serviceName, opid, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public OpenidConnectProviderContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOpenIdConnectProviders() + .updateWithResponse(resourceGroupName, serviceName, opid, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + OpenidConnectProviderContractImpl( + OpenidConnectProviderContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.opid = Utils.getValueFromIdByName(innerObject.id(), "openidConnectProviders"); + } + + public OpenidConnectProviderContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getOpenIdConnectProviders() + .getWithResponse(resourceGroupName, serviceName, opid, Context.NONE) + .getValue(); + return this; + } + + public OpenidConnectProviderContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOpenIdConnectProviders() + .getWithResponse(resourceGroupName, serviceName, opid, context) + .getValue(); + return this; + } + + public ClientSecretContract listSecrets() { + return serviceManager.openIdConnectProviders().listSecrets(resourceGroupName, serviceName, opid); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager + .openIdConnectProviders() + .listSecretsWithResponse(resourceGroupName, serviceName, opid, context); + } + + public OpenidConnectProviderContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.innerModel().withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public OpenidConnectProviderContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public OpenidConnectProviderContractImpl withMetadataEndpoint(String metadataEndpoint) { + if (isInCreateMode()) { + this.innerModel().withMetadataEndpoint(metadataEndpoint); + return this; + } else { + this.updateParameters.withMetadataEndpoint(metadataEndpoint); + return this; + } + } + + public OpenidConnectProviderContractImpl withClientId(String clientId) { + if (isInCreateMode()) { + this.innerModel().withClientId(clientId); + return this; + } else { + this.updateParameters.withClientId(clientId); + return this; + } + } + + public OpenidConnectProviderContractImpl withClientSecret(String clientSecret) { + if (isInCreateMode()) { + this.innerModel().withClientSecret(clientSecret); + return this; + } else { + this.updateParameters.withClientSecret(clientSecret); + return this; + } + } + + public OpenidConnectProviderContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationContractImpl.java new file mode 100644 index 0000000000000..311f0f2414d1b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationContractImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; +import com.azure.resourcemanager.apimanagement.models.OperationContract; +import com.azure.resourcemanager.apimanagement.models.OperationUpdateContract; +import com.azure.resourcemanager.apimanagement.models.ParameterContract; +import com.azure.resourcemanager.apimanagement.models.RequestContract; +import com.azure.resourcemanager.apimanagement.models.ResponseContract; +import java.util.Collections; +import java.util.List; + +public final class OperationContractImpl + implements OperationContract, OperationContract.Definition, OperationContract.Update { + private OperationContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List templateParameters() { + List inner = this.innerModel().templateParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public RequestContract request() { + return this.innerModel().request(); + } + + public List responses() { + List inner = this.innerModel().responses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String policies() { + return this.innerModel().policies(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String method() { + return this.innerModel().method(); + } + + public String urlTemplate() { + return this.innerModel().urlTemplate(); + } + + public OperationContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String operationId; + + private String createIfMatch; + + private String updateIfMatch; + + private OperationUpdateContract updateParameters; + + public OperationContractImpl withExistingApi(String resourceGroupName, String serviceName, String apiId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + return this; + } + + public OperationContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperations() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, operationId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public OperationContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperations() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, operationId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + OperationContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new OperationContractInner(); + this.serviceManager = serviceManager; + this.operationId = name; + this.createIfMatch = null; + } + + public OperationContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new OperationUpdateContract(); + return this; + } + + public OperationContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperations() + .updateWithResponse( + resourceGroupName, serviceName, apiId, operationId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public OperationContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperations() + .updateWithResponse( + resourceGroupName, serviceName, apiId, operationId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + OperationContractImpl( + OperationContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.operationId = Utils.getValueFromIdByName(innerObject.id(), "operations"); + } + + public OperationContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperations() + .getWithResponse(resourceGroupName, serviceName, apiId, operationId, Context.NONE) + .getValue(); + return this; + } + + public OperationContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperations() + .getWithResponse(resourceGroupName, serviceName, apiId, operationId, context) + .getValue(); + return this; + } + + public OperationContractImpl withTemplateParameters(List templateParameters) { + if (isInCreateMode()) { + this.innerModel().withTemplateParameters(templateParameters); + return this; + } else { + this.updateParameters.withTemplateParameters(templateParameters); + return this; + } + } + + public OperationContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public OperationContractImpl withRequest(RequestContract request) { + if (isInCreateMode()) { + this.innerModel().withRequest(request); + return this; + } else { + this.updateParameters.withRequest(request); + return this; + } + } + + public OperationContractImpl withResponses(List responses) { + if (isInCreateMode()) { + this.innerModel().withResponses(responses); + return this; + } else { + this.updateParameters.withResponses(responses); + return this; + } + } + + public OperationContractImpl withPolicies(String policies) { + if (isInCreateMode()) { + this.innerModel().withPolicies(policies); + return this; + } else { + this.updateParameters.withPolicies(policies); + return this; + } + } + + public OperationContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.innerModel().withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public OperationContractImpl withMethod(String method) { + if (isInCreateMode()) { + this.innerModel().withMethod(method); + return this; + } else { + this.updateParameters.withMethod(method); + return this; + } + } + + public OperationContractImpl withUrlTemplate(String urlTemplate) { + if (isInCreateMode()) { + this.innerModel().withUrlTemplate(urlTemplate); + return this; + } else { + this.updateParameters.withUrlTemplate(urlTemplate); + return this; + } + } + + public OperationContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationImpl.java new file mode 100644 index 0000000000000..d44f2641dd463 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.OperationInner; +import com.azure.resourcemanager.apimanagement.models.Operation; +import com.azure.resourcemanager.apimanagement.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationResultContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationResultContractImpl.java new file mode 100644 index 0000000000000..433811ab71053 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationResultContractImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.OperationResultContractInner; +import com.azure.resourcemanager.apimanagement.models.AsyncOperationStatus; +import com.azure.resourcemanager.apimanagement.models.ErrorResponseBody; +import com.azure.resourcemanager.apimanagement.models.OperationResultContract; +import com.azure.resourcemanager.apimanagement.models.OperationResultLogItemContract; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class OperationResultContractImpl implements OperationResultContract { + private OperationResultContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + OperationResultContractImpl( + OperationResultContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public AsyncOperationStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime started() { + return this.innerModel().started(); + } + + public OffsetDateTime updated() { + return this.innerModel().updated(); + } + + public String resultInfo() { + return this.innerModel().resultInfo(); + } + + public ErrorResponseBody error() { + return this.innerModel().error(); + } + + public List actionLog() { + List inner = this.innerModel().actionLog(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OperationResultContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..4b38a2a0d9abe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsClientImpl.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.OperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.TagResourceCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientO") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operationsByTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("includeNotTaggedOperations") Boolean includeNotTaggedOperations, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTagsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTags( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + includeNotTaggedOperations, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTags( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + includeNotTaggedOperations, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations) { + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync( + resourceGroupName, serviceName, apiId, filter, top, skip, includeNotTaggedOperations), + nextLink -> listByTagsNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean includeNotTaggedOperations = null; + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync( + resourceGroupName, serviceName, apiId, filter, top, skip, includeNotTaggedOperations), + nextLink -> listByTagsNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations, + Context context) { + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync( + resourceGroupName, serviceName, apiId, filter, top, skip, includeNotTaggedOperations, context), + nextLink -> listByTagsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTags( + String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean includeNotTaggedOperations = null; + return new PagedIterable<>( + listByTagsAsync(resourceGroupName, serviceName, apiId, filter, top, skip, includeNotTaggedOperations)); + } + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations, + Context context) { + return new PagedIterable<>( + listByTagsAsync( + resourceGroupName, serviceName, apiId, filter, top, skip, includeNotTaggedOperations, 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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsNextSinglePageAsync(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.listByTagsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsNextSinglePageAsync( + 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 + .listByTagsNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..d710393e5ae9b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OperationsImpl.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.apimanagement.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.apimanagement.fluent.OperationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.Operations; +import com.azure.resourcemanager.apimanagement.models.TagResourceContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByTags(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = + this.serviceClient().listByTags(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + public PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByTags( + resourceGroupName, serviceName, apiId, filter, top, skip, includeNotTaggedOperations, context); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesClientImpl.java new file mode 100644 index 0000000000000..0111afb9de250 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesClientImpl.java @@ -0,0 +1,1062 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.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.apimanagement.fluent.PoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PoliciesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.PoliciesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.PoliciesGetResponse; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +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 ApiManagementClientImpl client; + + /** + * Initializes an instance of PoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PoliciesClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(PoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface PoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/policies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("format") PolicyExportFormat format, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/policies/{policyId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PolicyContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/policies/{policyId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServiceAsync(String resourceGroupName, String serviceName) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyCollectionInner listByService(String resourceGroupName, String serviceName) { + return listByServiceAsync(resourceGroupName, serviceName).block(); + } + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 entity state (Etag) version of the Global policy definition in the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, PolicyIdName policyId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 entity state (Etag) version of the Global policy definition in the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, PolicyIdName policyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 entity state (Etag) version of the Global policy definition in the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, PolicyIdName policyId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, policyId) + .flatMap((PoliciesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, PolicyIdName policyId) { + getEntityTagAsync(resourceGroupName, serviceName, policyId).block(); + } + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 entity state (Etag) version of the Global policy definition in the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, policyId, context).block(); + } + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyExportFormat format) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + format, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + format, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyExportFormat format) { + return getWithResponseAsync(resourceGroupName, serviceName, policyId, format) + .flatMap( + (PoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getWithResponseAsync(resourceGroupName, serviceName, policyId, format) + .flatMap( + (PoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner get(String resourceGroupName, String serviceName, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getAsync(resourceGroupName, serviceName, policyId, format).block(); + } + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Global policy definition of the Api Management service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, policyId, format, context).block(); + } + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, policyId, parameters, ifMatch) + .flatMap( + (PoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, policyId, parameters, ifMatch) + .flatMap( + (PoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner createOrUpdate( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, policyId, parameters, ifMatch).block(); + } + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, policyId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, PolicyIdName policyId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, PolicyIdName policyId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, PolicyIdName policyId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, policyId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, PolicyIdName policyId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, policyId, ifMatch).block(); + } + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, policyId, ifMatch, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesImpl.java new file mode 100644 index 0000000000000..5ca8484f39139 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PoliciesImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.PoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.Policies; +import com.azure.resourcemanager.apimanagement.models.PolicyCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyContract; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +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.apimanagement.ApiManagementManager serviceManager; + + public PoliciesImpl( + PoliciesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PolicyCollection listByService(String resourceGroupName, String serviceName) { + PolicyCollectionInner inner = this.serviceClient().listByService(resourceGroupName, serviceName); + if (inner != null) { + return new PolicyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().listByServiceWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void getEntityTag(String resourceGroupName, String serviceName, PolicyIdName policyId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, policyId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, policyId, context); + } + + public PolicyContract get(String resourceGroupName, String serviceName, PolicyIdName policyId) { + PolicyContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, policyId); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, policyId, format, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PolicyContract createOrUpdate( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyContractInner parameters) { + PolicyContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, policyId, parameters); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, policyId, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, PolicyIdName policyId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, policyId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, policyId, ifMatch, context); + } + + private PoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyCollectionImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyCollectionImpl.java new file mode 100644 index 0000000000000..86455e9e0d57f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyCollectionImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyContract; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PolicyCollectionImpl implements PolicyCollection { + private PolicyCollectionInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PolicyCollectionImpl( + PolicyCollectionInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PolicyContractImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Long count() { + return this.innerModel().count(); + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public PolicyCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyContractImpl.java new file mode 100644 index 0000000000000..185ec1af32bc4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyContractImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyContentFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyContract; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; + +public final class PolicyContractImpl implements PolicyContract, PolicyContract.Definition, PolicyContract.Update { + private PolicyContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String value() { + return this.innerModel().value(); + } + + public PolicyContentFormat format() { + return this.innerModel().format(); + } + + public PolicyContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String operationId; + + private PolicyIdName policyId; + + private String createIfMatch; + + private String updateIfMatch; + + public PolicyContractImpl withExistingOperation( + String resourceGroupName, String serviceName, String apiId, String operationId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + this.operationId = operationId; + return this; + } + + public PolicyContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperationPolicies() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + this.innerModel(), + createIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public PolicyContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperationPolicies() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + this.innerModel(), + createIfMatch, + context) + .getValue(); + return this; + } + + PolicyContractImpl(PolicyIdName name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new PolicyContractInner(); + this.serviceManager = serviceManager; + this.policyId = name; + this.createIfMatch = null; + } + + public PolicyContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public PolicyContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperationPolicies() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + this.innerModel(), + updateIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public PolicyContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiOperationPolicies() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + operationId, + policyId, + this.innerModel(), + updateIfMatch, + context) + .getValue(); + return this; + } + + PolicyContractImpl( + PolicyContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.operationId = Utils.getValueFromIdByName(innerObject.id(), "operations"); + this.policyId = PolicyIdName.fromString(Utils.getValueFromIdByName(innerObject.id(), "policies")); + } + + public PolicyContract refresh() { + PolicyExportFormat localFormat = null; + this.innerObject = + serviceManager + .serviceClient() + .getApiOperationPolicies() + .getWithResponse( + resourceGroupName, serviceName, apiId, operationId, policyId, localFormat, Context.NONE) + .getValue(); + return this; + } + + public PolicyContract refresh(Context context) { + PolicyExportFormat localFormat = null; + this.innerObject = + serviceManager + .serviceClient() + .getApiOperationPolicies() + .getWithResponse(resourceGroupName, serviceName, apiId, operationId, policyId, localFormat, context) + .getValue(); + return this; + } + + public PolicyContractImpl withValue(String value) { + this.innerModel().withValue(value); + return this; + } + + public PolicyContractImpl withFormat(PolicyContentFormat format) { + this.innerModel().withFormat(format); + return this; + } + + public PolicyContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionCollectionImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionCollectionImpl.java new file mode 100644 index 0000000000000..fecf21f064eda --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionCollectionImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyDescriptionCollectionInner; +import com.azure.resourcemanager.apimanagement.models.PolicyDescriptionCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyDescriptionContract; +import java.util.Collections; +import java.util.List; + +public final class PolicyDescriptionCollectionImpl implements PolicyDescriptionCollection { + private PolicyDescriptionCollectionInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PolicyDescriptionCollectionImpl( + PolicyDescriptionCollectionInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Long count() { + return this.innerModel().count(); + } + + public PolicyDescriptionCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsClientImpl.java new file mode 100644 index 0000000000000..ab5621bbb1d32 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsClientImpl.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.apimanagement.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.apimanagement.fluent.PolicyDescriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyDescriptionCollectionInner; +import com.azure.resourcemanager.apimanagement.models.PolicyScopeContract; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PolicyDescriptionsClient. */ +public final class PolicyDescriptionsClientImpl implements PolicyDescriptionsClient { + private final ClientLogger logger = new ClientLogger(PolicyDescriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PolicyDescriptionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of PolicyDescriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PolicyDescriptionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(PolicyDescriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientPolicyDescriptions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface PolicyDescriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/policyDescriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("scope") PolicyScopeContract scope, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param scope Policy scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, PolicyScopeContract scope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + scope, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param scope Policy scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, PolicyScopeContract scope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + scope, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param scope Policy scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServiceAsync( + String resourceGroupName, String serviceName, PolicyScopeContract scope) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, scope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServiceAsync(String resourceGroupName, String serviceName) { + final PolicyScopeContract scope = null; + return listByServiceWithResponseAsync(resourceGroupName, serviceName, scope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyDescriptionCollectionInner listByService(String resourceGroupName, String serviceName) { + final PolicyScopeContract scope = null; + return listByServiceAsync(resourceGroupName, serviceName, scope).block(); + } + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param scope Policy scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, PolicyScopeContract scope, Context context) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, scope, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsImpl.java new file mode 100644 index 0000000000000..c8279827ec145 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PolicyDescriptionsImpl.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.apimanagement.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.apimanagement.fluent.PolicyDescriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyDescriptionCollectionInner; +import com.azure.resourcemanager.apimanagement.models.PolicyDescriptionCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyDescriptions; +import com.azure.resourcemanager.apimanagement.models.PolicyScopeContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PolicyDescriptionsImpl implements PolicyDescriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDescriptionsImpl.class); + + private final PolicyDescriptionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public PolicyDescriptionsImpl( + PolicyDescriptionsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PolicyDescriptionCollection listByService(String resourceGroupName, String serviceName) { + PolicyDescriptionCollectionInner inner = this.serviceClient().listByService(resourceGroupName, serviceName); + if (inner != null) { + return new PolicyDescriptionCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, PolicyScopeContract scope, Context context) { + Response inner = + this.serviceClient().listByServiceWithResponse(resourceGroupName, serviceName, scope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyDescriptionCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PolicyDescriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalDelegationSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalDelegationSettingsImpl.java new file mode 100644 index 0000000000000..be1d40c55f0f7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalDelegationSettingsImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner; +import com.azure.resourcemanager.apimanagement.models.PortalDelegationSettings; +import com.azure.resourcemanager.apimanagement.models.RegistrationDelegationSettingsProperties; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsDelegationSettingsProperties; + +public final class PortalDelegationSettingsImpl implements PortalDelegationSettings { + private PortalDelegationSettingsInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PortalDelegationSettingsImpl( + PortalDelegationSettingsInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 url() { + return this.innerModel().url(); + } + + public String validationKey() { + return this.innerModel().validationKey(); + } + + public SubscriptionsDelegationSettingsProperties subscriptions() { + return this.innerModel().subscriptions(); + } + + public RegistrationDelegationSettingsProperties userRegistration() { + return this.innerModel().userRegistration(); + } + + public PortalDelegationSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionContractImpl.java new file mode 100644 index 0000000000000..dab99a1f93db6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionContractImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; +import com.azure.resourcemanager.apimanagement.models.PortalRevisionContract; +import com.azure.resourcemanager.apimanagement.models.PortalRevisionStatus; +import java.time.OffsetDateTime; + +public final class PortalRevisionContractImpl + implements PortalRevisionContract, PortalRevisionContract.Definition, PortalRevisionContract.Update { + private PortalRevisionContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String statusDetails() { + return this.innerModel().statusDetails(); + } + + public PortalRevisionStatus status() { + return this.innerModel().status(); + } + + public Boolean isCurrent() { + return this.innerModel().isCurrent(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public OffsetDateTime updatedDateTime() { + return this.innerModel().updatedDateTime(); + } + + public PortalRevisionContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String portalRevisionId; + + private String updateIfMatch; + + public PortalRevisionContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public PortalRevisionContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getPortalRevisions() + .createOrUpdate(resourceGroupName, serviceName, portalRevisionId, this.innerModel(), Context.NONE); + return this; + } + + public PortalRevisionContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPortalRevisions() + .createOrUpdate(resourceGroupName, serviceName, portalRevisionId, this.innerModel(), context); + return this; + } + + PortalRevisionContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new PortalRevisionContractInner(); + this.serviceManager = serviceManager; + this.portalRevisionId = name; + } + + public PortalRevisionContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public PortalRevisionContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPortalRevisions() + .update( + resourceGroupName, serviceName, portalRevisionId, updateIfMatch, this.innerModel(), Context.NONE); + return this; + } + + public PortalRevisionContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPortalRevisions() + .update(resourceGroupName, serviceName, portalRevisionId, updateIfMatch, this.innerModel(), context); + return this; + } + + PortalRevisionContractImpl( + PortalRevisionContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.portalRevisionId = Utils.getValueFromIdByName(innerObject.id(), "portalRevisions"); + } + + public PortalRevisionContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPortalRevisions() + .getWithResponse(resourceGroupName, serviceName, portalRevisionId, Context.NONE) + .getValue(); + return this; + } + + public PortalRevisionContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPortalRevisions() + .getWithResponse(resourceGroupName, serviceName, portalRevisionId, context) + .getValue(); + return this; + } + + public PortalRevisionContractImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public PortalRevisionContractImpl withIsCurrent(Boolean isCurrent) { + this.innerModel().withIsCurrent(isCurrent); + return this; + } + + public PortalRevisionContractImpl withIfMatch(String ifMatch) { + this.updateIfMatch = ifMatch; + return this; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsClientImpl.java new file mode 100644 index 0000000000000..8363b1b071fce --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsClientImpl.java @@ -0,0 +1,1508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.apimanagement.fluent.PortalRevisionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; +import com.azure.resourcemanager.apimanagement.models.PortalRevisionCollection; +import com.azure.resourcemanager.apimanagement.models.PortalRevisionsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.PortalRevisionsGetResponse; +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 PortalRevisionsClient. */ +public final class PortalRevisionsClientImpl implements PortalRevisionsClient { + private final ClientLogger logger = new ClientLogger(PortalRevisionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PortalRevisionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of PortalRevisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PortalRevisionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(PortalRevisionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientPortalRevisions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface PortalRevisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalRevisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalRevisions/{portalRevisionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("portalRevisionId") String portalRevisionId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalRevisions/{portalRevisionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("portalRevisionId") String portalRevisionId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalRevisions/{portalRevisionId}") + @ExpectedResponses({201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("portalRevisionId") String portalRevisionId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalRevisionContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalRevisions/{portalRevisionId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("portalRevisionId") String portalRevisionId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalRevisionContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String portalRevisionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String portalRevisionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String portalRevisionId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, portalRevisionId) + .flatMap((PortalRevisionsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String portalRevisionId) { + getEntityTagAsync(resourceGroupName, serviceName, portalRevisionId).block(); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, portalRevisionId, context).block(); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String portalRevisionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String portalRevisionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String portalRevisionId) { + return getWithResponseAsync(resourceGroupName, serviceName, portalRevisionId) + .flatMap( + (PortalRevisionsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalRevisionContractInner get(String resourceGroupName, String serviceName, String portalRevisionId) { + return getAsync(resourceGroupName, serviceName, portalRevisionId).block(); + } + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, portalRevisionId, context).block(); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PortalRevisionContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, portalRevisionId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PortalRevisionContractInner.class, + PortalRevisionContractInner.class, + Context.NONE); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PortalRevisionContractInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, portalRevisionId, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PortalRevisionContractInner.class, + PortalRevisionContractInner.class, + context); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PortalRevisionContractInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, portalRevisionId, parameters).getSyncPoller(); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PortalRevisionContractInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, portalRevisionId, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, portalRevisionId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, portalRevisionId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalRevisionContractInner createOrUpdate( + String resourceGroupName, String serviceName, String portalRevisionId, PortalRevisionContractInner parameters) { + return createOrUpdateAsync(resourceGroupName, serviceName, portalRevisionId, parameters).block(); + } + + /** + * Creates a new developer portal revision. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalRevisionContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + PortalRevisionContractInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, portalRevisionId, parameters, context).block(); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (portalRevisionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portalRevisionId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + portalRevisionId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PortalRevisionContractInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PortalRevisionContractInner.class, + PortalRevisionContractInner.class, + Context.NONE); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PortalRevisionContractInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PortalRevisionContractInner.class, + PortalRevisionContractInner.class, + context); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PortalRevisionContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters) { + return beginUpdateAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters).getSyncPoller(); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PortalRevisionContractInner> beginUpdate( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters) { + return beginUpdateAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalRevisionContractInner update( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters) { + return updateAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters).block(); + } + + /** + * Updates the description of specified portal revision or makes it current. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Portal revisions contract details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return portal revisions contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalRevisionContractInner update( + String resourceGroupName, + String serviceName, + String portalRevisionId, + String ifMatch, + PortalRevisionContractInner parameters, + Context context) { + return updateAsync(resourceGroupName, serviceName, portalRevisionId, ifMatch, parameters, 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 paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsImpl.java new file mode 100644 index 0000000000000..22c275ddd6921 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalRevisionsImpl.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.apimanagement.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.apimanagement.fluent.PortalRevisionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; +import com.azure.resourcemanager.apimanagement.models.PortalRevisionContract; +import com.azure.resourcemanager.apimanagement.models.PortalRevisions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PortalRevisionsImpl implements PortalRevisions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionsImpl.class); + + private final PortalRevisionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public PortalRevisionsImpl( + PortalRevisionsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new PortalRevisionContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new PortalRevisionContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String portalRevisionId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, portalRevisionId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, portalRevisionId, context); + } + + public PortalRevisionContract get(String resourceGroupName, String serviceName, String portalRevisionId) { + PortalRevisionContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, portalRevisionId); + if (inner != null) { + return new PortalRevisionContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, portalRevisionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalRevisionContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PortalRevisionContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String portalRevisionId = Utils.getValueFromIdByName(id, "portalRevisions"); + if (portalRevisionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'portalRevisions'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, portalRevisionId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String portalRevisionId = Utils.getValueFromIdByName(id, "portalRevisions"); + if (portalRevisionId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'portalRevisions'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, portalRevisionId, context); + } + + private PortalRevisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public PortalRevisionContractImpl define(String name) { + return new PortalRevisionContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingValidationKeyContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingValidationKeyContractImpl.java new file mode 100644 index 0000000000000..258231496d28b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingValidationKeyContractImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingValidationKeyContractInner; +import com.azure.resourcemanager.apimanagement.models.PortalSettingValidationKeyContract; + +public final class PortalSettingValidationKeyContractImpl implements PortalSettingValidationKeyContract { + private PortalSettingValidationKeyContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PortalSettingValidationKeyContractImpl( + PortalSettingValidationKeyContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String validationKey() { + return this.innerModel().validationKey(); + } + + public PortalSettingValidationKeyContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsClientImpl.java new file mode 100644 index 0000000000000..23f1fd5026e17 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsClientImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.PortalSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingsCollectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PortalSettingsClient. */ +public final class PortalSettingsClientImpl implements PortalSettingsClient { + private final ClientLogger logger = new ClientLogger(PortalSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PortalSettingsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of PortalSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PortalSettingsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(PortalSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientPortalSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface PortalSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServiceAsync(String resourceGroupName, String serviceName) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalSettingsCollectionInner listByService(String resourceGroupName, String serviceName) { + return listByServiceAsync(resourceGroupName, serviceName).block(); + } + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsCollectionImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsCollectionImpl.java new file mode 100644 index 0000000000000..05b8e7bad70a1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsCollectionImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingsCollectionInner; +import com.azure.resourcemanager.apimanagement.models.PortalSettingsCollection; +import com.azure.resourcemanager.apimanagement.models.PortalSettingsContract; +import java.util.Collections; +import java.util.List; + +public final class PortalSettingsCollectionImpl implements PortalSettingsCollection { + private PortalSettingsCollectionInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PortalSettingsCollectionImpl( + PortalSettingsCollectionInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Long count() { + return this.innerModel().count(); + } + + public PortalSettingsCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsImpl.java new file mode 100644 index 0000000000000..20ca7f02ac19c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSettingsImpl.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.apimanagement.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.apimanagement.fluent.PortalSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingsCollectionInner; +import com.azure.resourcemanager.apimanagement.models.PortalSettings; +import com.azure.resourcemanager.apimanagement.models.PortalSettingsCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PortalSettingsImpl implements PortalSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalSettingsImpl.class); + + private final PortalSettingsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public PortalSettingsImpl( + PortalSettingsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PortalSettingsCollection listByService(String resourceGroupName, String serviceName) { + PortalSettingsCollectionInner inner = this.serviceClient().listByService(resourceGroupName, serviceName); + if (inner != null) { + return new PortalSettingsCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().listByServiceWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalSettingsCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PortalSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSigninSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSigninSettingsImpl.java new file mode 100644 index 0000000000000..41a408f5b26bd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSigninSettingsImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; +import com.azure.resourcemanager.apimanagement.models.PortalSigninSettings; + +public final class PortalSigninSettingsImpl implements PortalSigninSettings { + private PortalSigninSettingsInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PortalSigninSettingsImpl( + PortalSigninSettingsInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 Boolean enabled() { + return this.innerModel().enabled(); + } + + public PortalSigninSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSignupSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSignupSettingsImpl.java new file mode 100644 index 0000000000000..f48c2b3e4126a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/PortalSignupSettingsImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner; +import com.azure.resourcemanager.apimanagement.models.PortalSignupSettings; +import com.azure.resourcemanager.apimanagement.models.TermsOfServiceProperties; + +public final class PortalSignupSettingsImpl implements PortalSignupSettings { + private PortalSignupSettingsInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + PortalSignupSettingsImpl( + PortalSignupSettingsInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 Boolean enabled() { + return this.innerModel().enabled(); + } + + public TermsOfServiceProperties termsOfService() { + return this.innerModel().termsOfService(); + } + + public PortalSignupSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisClientImpl.java new file mode 100644 index 0000000000000..a8770ee88d97d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisClientImpl.java @@ -0,0 +1,1034 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ProductApisClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductApisClient. */ +public final class ProductApisClientImpl implements ProductApisClient { + private final ClientLogger logger = new ClientLogger(ProductApisClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductApisService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ProductApisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductApisClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ProductApisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientProductApis to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface ProductApisService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/apis") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/apis/{apiId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEntityExists( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/apis/{apiId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/apis/{apiId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("apiId") String apiId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProductNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip, context), + nextLink -> listByProductNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByProductAsync(resourceGroupName, serviceName, productId, filter, top, skip)); + } + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByProductAsync(resourceGroupName, serviceName, productId, filter, top, skip, context)); + } + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 checkEntityExistsAsync( + String resourceGroupName, String serviceName, String productId, String apiId) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, productId, apiId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 checkEntityExists(String resourceGroupName, String serviceName, String productId, String apiId) { + checkEntityExistsAsync(resourceGroupName, serviceName, productId, apiId).block(); + } + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, productId, apiId, context).block(); + } + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String productId, String apiId) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, apiId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiContractInner createOrUpdate( + String resourceGroupName, String serviceName, String productId, String apiId) { + return createOrUpdateAsync(resourceGroupName, serviceName, productId, apiId).block(); + } + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, apiId, context).block(); + } + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String apiId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String apiId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + apiId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String apiId) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, apiId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String productId, String apiId) { + deleteAsync(resourceGroupName, serviceName, productId, apiId).block(); + } + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, apiId, 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 paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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.listByProductNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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 + .listByProductNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisImpl.java new file mode 100644 index 0000000000000..94af280c20691 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductApisImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ProductApisClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiContract; +import com.azure.resourcemanager.apimanagement.models.ProductApis; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductApisImpl implements ProductApis { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductApisImpl.class); + + private final ProductApisClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ProductApisImpl( + ProductApisClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, productId); + return Utils.mapPage(inner, inner1 -> new ApiContractImpl(inner1, this.manager())); + } + + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, productId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ApiContractImpl(inner1, this.manager())); + } + + public void checkEntityExists(String resourceGroupName, String serviceName, String productId, String apiId) { + this.serviceClient().checkEntityExists(resourceGroupName, serviceName, productId, apiId); + } + + public Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + return this + .serviceClient() + .checkEntityExistsWithResponse(resourceGroupName, serviceName, productId, apiId, context); + } + + public ApiContract createOrUpdate(String resourceGroupName, String serviceName, String productId, String apiId) { + ApiContractInner inner = this.serviceClient().createOrUpdate(resourceGroupName, serviceName, productId, apiId); + if (inner != null) { + return new ApiContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(resourceGroupName, serviceName, productId, apiId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String productId, String apiId) { + this.serviceClient().delete(resourceGroupName, serviceName, productId, apiId); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, productId, apiId, context); + } + + private ProductApisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductContractImpl.java new file mode 100644 index 0000000000000..db707c70a9fba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductContractImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.azure.resourcemanager.apimanagement.models.ProductContract; +import com.azure.resourcemanager.apimanagement.models.ProductState; +import com.azure.resourcemanager.apimanagement.models.ProductUpdateParameters; + +public final class ProductContractImpl implements ProductContract, ProductContract.Definition, ProductContract.Update { + private ProductContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String terms() { + return this.innerModel().terms(); + } + + public Boolean subscriptionRequired() { + return this.innerModel().subscriptionRequired(); + } + + public Boolean approvalRequired() { + return this.innerModel().approvalRequired(); + } + + public Integer subscriptionsLimit() { + return this.innerModel().subscriptionsLimit(); + } + + public ProductState state() { + return this.innerModel().state(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public ProductContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String productId; + + private String createIfMatch; + + private String updateIfMatch; + + private ProductUpdateParameters updateParameters; + + public ProductContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ProductContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getProducts() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, productId, this.innerModel(), createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public ProductContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProducts() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, productId, this.innerModel(), createIfMatch, context) + .getValue(); + return this; + } + + ProductContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new ProductContractInner(); + this.serviceManager = serviceManager; + this.productId = name; + this.createIfMatch = null; + } + + public ProductContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new ProductUpdateParameters(); + return this; + } + + public ProductContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProducts() + .updateWithResponse( + resourceGroupName, serviceName, productId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ProductContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProducts() + .updateWithResponse(resourceGroupName, serviceName, productId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + ProductContractImpl( + ProductContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.productId = Utils.getValueFromIdByName(innerObject.id(), "products"); + } + + public ProductContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProducts() + .getWithResponse(resourceGroupName, serviceName, productId, Context.NONE) + .getValue(); + return this; + } + + public ProductContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProducts() + .getWithResponse(resourceGroupName, serviceName, productId, context) + .getValue(); + return this; + } + + public ProductContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public ProductContractImpl withTerms(String terms) { + if (isInCreateMode()) { + this.innerModel().withTerms(terms); + return this; + } else { + this.updateParameters.withTerms(terms); + return this; + } + } + + public ProductContractImpl withSubscriptionRequired(Boolean subscriptionRequired) { + if (isInCreateMode()) { + this.innerModel().withSubscriptionRequired(subscriptionRequired); + return this; + } else { + this.updateParameters.withSubscriptionRequired(subscriptionRequired); + return this; + } + } + + public ProductContractImpl withApprovalRequired(Boolean approvalRequired) { + if (isInCreateMode()) { + this.innerModel().withApprovalRequired(approvalRequired); + return this; + } else { + this.updateParameters.withApprovalRequired(approvalRequired); + return this; + } + } + + public ProductContractImpl withSubscriptionsLimit(Integer subscriptionsLimit) { + if (isInCreateMode()) { + this.innerModel().withSubscriptionsLimit(subscriptionsLimit); + return this; + } else { + this.updateParameters.withSubscriptionsLimit(subscriptionsLimit); + return this; + } + } + + public ProductContractImpl withState(ProductState state) { + if (isInCreateMode()) { + this.innerModel().withState(state); + return this; + } else { + this.updateParameters.withState(state); + return this; + } + } + + public ProductContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.innerModel().withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public ProductContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsClientImpl.java new file mode 100644 index 0000000000000..c7333ab6624ad --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsClientImpl.java @@ -0,0 +1,1004 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ProductGroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductGroupsClient. */ +public final class ProductGroupsClientImpl implements ProductGroupsClient { + private final ClientLogger logger = new ClientLogger(ProductGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductGroupsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ProductGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductGroupsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ProductGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientProductGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface ProductGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/groups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/groups/{groupId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEntityExists( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/groups/{groupId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/groups/{groupId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProductNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip, context), + nextLink -> listByProductNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByProductAsync(resourceGroupName, serviceName, productId, filter, top, skip)); + } + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByProductAsync(resourceGroupName, serviceName, productId, filter, top, skip, context)); + } + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> checkEntityExistsWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEntityExists( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 checkEntityExistsAsync( + String resourceGroupName, String serviceName, String productId, String groupId) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, productId, groupId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 checkEntityExists(String resourceGroupName, String serviceName, String productId, String groupId) { + checkEntityExistsAsync(resourceGroupName, serviceName, productId, groupId).block(); + } + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + return checkEntityExistsWithResponseAsync(resourceGroupName, serviceName, productId, groupId, context).block(); + } + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String productId, String groupId) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, groupId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GroupContractInner createOrUpdate( + String resourceGroupName, String serviceName, String productId, String groupId) { + return createOrUpdateAsync(resourceGroupName, serviceName, productId, groupId).block(); + } + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, groupId, context).block(); + } + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + groupId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String groupId) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, groupId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String productId, String groupId) { + deleteAsync(resourceGroupName, serviceName, productId, groupId).block(); + } + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, groupId, 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 paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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.listByProductNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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 + .listByProductNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsImpl.java new file mode 100644 index 0000000000000..5fa9693f159a9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductGroupsImpl.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.apimanagement.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.apimanagement.fluent.ProductGroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupContract; +import com.azure.resourcemanager.apimanagement.models.ProductGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductGroupsImpl implements ProductGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductGroupsImpl.class); + + private final ProductGroupsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ProductGroupsImpl( + ProductGroupsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, productId); + return Utils.mapPage(inner, inner1 -> new GroupContractImpl(inner1, this.manager())); + } + + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, productId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new GroupContractImpl(inner1, this.manager())); + } + + public void checkEntityExists(String resourceGroupName, String serviceName, String productId, String groupId) { + this.serviceClient().checkEntityExists(resourceGroupName, serviceName, productId, groupId); + } + + public Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + return this + .serviceClient() + .checkEntityExistsWithResponse(resourceGroupName, serviceName, productId, groupId, context); + } + + public GroupContract createOrUpdate( + String resourceGroupName, String serviceName, String productId, String groupId) { + GroupContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, productId, groupId); + if (inner != null) { + return new GroupContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, productId, groupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GroupContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String productId, String groupId) { + this.serviceClient().delete(resourceGroupName, serviceName, productId, groupId); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, productId, groupId, context); + } + + private ProductGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesClientImpl.java new file mode 100644 index 0000000000000..d114798a91b2a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesClientImpl.java @@ -0,0 +1,1173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +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.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.apimanagement.fluent.ProductPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +import com.azure.resourcemanager.apimanagement.models.ProductPoliciesCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ProductPoliciesGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ProductPoliciesGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductPoliciesClient. */ +public final class ProductPoliciesClientImpl implements ProductPoliciesClient { + private final ClientLogger logger = new ClientLogger(ProductPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductPoliciesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ProductPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductPoliciesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(ProductPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientProductPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface ProductPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/policies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/policies/{policyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("policyId") PolicyIdName policyId, + @QueryParam("format") PolicyExportFormat format, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/policies/{policyId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PolicyContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/policies/{policyId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("policyId") PolicyIdName policyId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByProductAsync( + String resourceGroupName, String serviceName, String productId) { + return listByProductWithResponseAsync(resourceGroupName, serviceName, productId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyCollectionInner listByProduct(String resourceGroupName, String serviceName, String productId) { + return listByProductAsync(resourceGroupName, serviceName, productId).block(); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByProductWithResponse( + String resourceGroupName, String serviceName, String productId, Context context) { + return listByProductWithResponseAsync(resourceGroupName, serviceName, productId, context).block(); + } + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 ETag of the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 ETag of the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 ETag of the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, productId, policyId) + .flatMap((ProductPoliciesGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + getEntityTagAsync(resourceGroupName, serviceName, productId, policyId).block(); + } + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 ETag of the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, productId, policyId, context).block(); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + format, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + format, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format) { + return getWithResponseAsync(resourceGroupName, serviceName, productId, policyId, format) + .flatMap( + (ProductPoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getWithResponseAsync(resourceGroupName, serviceName, productId, policyId, format) + .flatMap( + (ProductPoliciesGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner get( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + final PolicyExportFormat format = null; + return getAsync(resourceGroupName, serviceName, productId, policyId, format).block(); + } + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, productId, policyId, format, context).block(); + } + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, policyId, parameters, ifMatch) + .flatMap( + (ProductPoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, policyId, parameters, ifMatch) + .flatMap( + (ProductPoliciesCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyContractInner createOrUpdate( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, productId, policyId, parameters, ifMatch).block(); + } + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, productId, policyId, parameters, ifMatch, context) + .block(); + } + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, PolicyIdName policyId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String productId, + PolicyIdName policyId, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (policyId == null) { + return Mono.error(new IllegalArgumentException("Parameter policyId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + policyId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, PolicyIdName policyId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, policyId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String productId, PolicyIdName policyId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, productId, policyId, ifMatch).block(); + } + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + String ifMatch, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, policyId, ifMatch, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesImpl.java new file mode 100644 index 0000000000000..da581436343a1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductPoliciesImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ProductPoliciesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; +import com.azure.resourcemanager.apimanagement.models.PolicyCollection; +import com.azure.resourcemanager.apimanagement.models.PolicyContract; +import com.azure.resourcemanager.apimanagement.models.PolicyExportFormat; +import com.azure.resourcemanager.apimanagement.models.PolicyIdName; +import com.azure.resourcemanager.apimanagement.models.ProductPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductPoliciesImpl implements ProductPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductPoliciesImpl.class); + + private final ProductPoliciesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ProductPoliciesImpl( + ProductPoliciesClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PolicyCollection listByProduct(String resourceGroupName, String serviceName, String productId) { + PolicyCollectionInner inner = this.serviceClient().listByProduct(resourceGroupName, serviceName, productId); + if (inner != null) { + return new PolicyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByProductWithResponse( + String resourceGroupName, String serviceName, String productId, Context context) { + Response inner = + this.serviceClient().listByProductWithResponse(resourceGroupName, serviceName, productId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void getEntityTag(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, productId, policyId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId, Context context) { + return this + .serviceClient() + .getEntityTagWithResponse(resourceGroupName, serviceName, productId, policyId, context); + } + + public PolicyContract get(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId) { + PolicyContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, productId, policyId); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, productId, policyId, format, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PolicyContract createOrUpdate( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters) { + PolicyContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, productId, policyId, parameters); + if (inner != null) { + return new PolicyContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, productId, policyId, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PolicyContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, productId, policyId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + String ifMatch, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, productId, policyId, ifMatch, context); + } + + private ProductPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..f9b3f2e369514 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsClientImpl.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ProductSubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.SubscriptionCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductSubscriptionsClient. */ +public final class ProductSubscriptionsClientImpl implements ProductSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(ProductSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductSubscriptionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ProductSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductSubscriptionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(ProductSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientProductSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface ProductSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/subscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, productId, filter, top, skip)); + } + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, productId, filter, top, skip, 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 paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsImpl.java new file mode 100644 index 0000000000000..ed7c806d2fa4d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductSubscriptionsImpl.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.apimanagement.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.apimanagement.fluent.ProductSubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.ProductSubscriptions; +import com.azure.resourcemanager.apimanagement.models.SubscriptionContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductSubscriptionsImpl implements ProductSubscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductSubscriptionsImpl.class); + + private final ProductSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ProductSubscriptionsImpl( + ProductSubscriptionsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName, String productId) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, productId); + return Utils.mapPage(inner, inner1 -> new SubscriptionContractImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, productId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new SubscriptionContractImpl(inner1, this.manager())); + } + + private ProductSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsClientImpl.java new file mode 100644 index 0000000000000..28e1d0df31f8d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsClientImpl.java @@ -0,0 +1,1957 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.ProductsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ProductCollection; +import com.azure.resourcemanager.apimanagement.models.ProductUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.ProductsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.ProductsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.ProductsGetResponse; +import com.azure.resourcemanager.apimanagement.models.ProductsUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.TagResourceCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProductsClient. */ +public final class ProductsClientImpl implements ProductsClient { + private final ClientLogger logger = new ClientLogger(ProductsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProductsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of ProductsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductsClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(ProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientProducts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientP") + private interface ProductsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("expandGroups") Boolean expandGroups, + @QueryParam("tags") String tags, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ProductContractInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ProductUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("deleteSubscriptions") Boolean deleteSubscriptions, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/productsByTags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("includeNotTaggedProducts") Boolean includeNotTaggedProducts, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @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> listByTagsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + expandGroups, + tags, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + expandGroups, + tags, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean expandGroups = null; + final String tags = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, expandGroups, tags, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean expandGroups = null; + final String tags = null; + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags)); + } + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags, context)); + } + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String productId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String productId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String productId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, productId) + .flatMap((ProductsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String productId) { + getEntityTagAsync(resourceGroupName, serviceName, productId).block(); + } + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, productId, context).block(); + } + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String productId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String productId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String productId) { + return getWithResponseAsync(resourceGroupName, serviceName, productId) + .flatMap( + (ProductsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductContractInner get(String resourceGroupName, String serviceName, String productId) { + return getAsync(resourceGroupName, serviceName, productId).block(); + } + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String productId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, productId, context).block(); + } + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + ProductContractInner parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + ProductContractInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String productId, + ProductContractInner parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, parameters, ifMatch) + .flatMap( + (ProductsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String productId, ProductContractInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, parameters, ifMatch) + .flatMap( + (ProductsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductContractInner createOrUpdate( + String resourceGroupName, String serviceName, String productId, ProductContractInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, productId, parameters, ifMatch).block(); + } + + /** + * Creates or Updates a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + ProductContractInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, productId, parameters, ifMatch, context) + .block(); + } + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, productId, ifMatch, parameters) + .flatMap( + (ProductsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductContractInner update( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, productId, ifMatch, parameters).block(); + } + + /** + * Update existing product details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return product details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + ProductUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, productId, ifMatch, parameters, context).block(); + } + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String ifMatch, Boolean deleteSubscriptions) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + ifMatch, + deleteSubscriptions, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String productId, + String ifMatch, + Boolean deleteSubscriptions, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + ifMatch, + deleteSubscriptions, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String ifMatch, Boolean deleteSubscriptions) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String productId, String ifMatch) { + final Boolean deleteSubscriptions = null; + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String productId, String ifMatch) { + final Boolean deleteSubscriptions = null; + deleteAsync(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions).block(); + } + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + Boolean deleteSubscriptions, + Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions, context) + .block(); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTags( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + includeNotTaggedProducts, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTags( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + includeNotTaggedProducts, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts) { + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts), + nextLink -> listByTagsNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean includeNotTaggedProducts = null; + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts), + nextLink -> listByTagsNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTagsAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts, + Context context) { + return new PagedFlux<>( + () -> + listByTagsSinglePageAsync( + resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts, context), + nextLink -> listByTagsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTags(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean includeNotTaggedProducts = null; + return new PagedIterable<>( + listByTagsAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts)); + } + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts, + Context context) { + return new PagedIterable<>( + listByTagsAsync(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts, 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 paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsNextSinglePageAsync(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.listByTagsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTagsNextSinglePageAsync( + 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 + .listByTagsNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsImpl.java new file mode 100644 index 0000000000000..503af4347a43b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsImpl.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.apimanagement.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.apimanagement.fluent.ProductsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ProductContract; +import com.azure.resourcemanager.apimanagement.models.Products; +import com.azure.resourcemanager.apimanagement.models.TagResourceContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProductsImpl implements Products { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsImpl.class); + + private final ProductsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ProductsImpl( + ProductsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ProductContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags, context); + return Utils.mapPage(inner, inner1 -> new ProductContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String productId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, productId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, productId, context); + } + + public ProductContract get(String resourceGroupName, String serviceName, String productId) { + ProductContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, productId); + if (inner != null) { + return new ProductContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String productId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, productId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProductContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String productId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, productId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + Boolean deleteSubscriptions, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions, context); + } + + public PagedIterable listByTags(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByTags(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + public PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByTags(resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts, context); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + public ProductContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String productId = Utils.getValueFromIdByName(id, "products"); + if (productId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, productId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String productId = Utils.getValueFromIdByName(id, "products"); + if (productId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, productId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String productId = Utils.getValueFromIdByName(id, "products"); + if (productId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + } + String localIfMatch = null; + Boolean localDeleteSubscriptions = null; + this + .deleteWithResponse( + resourceGroupName, serviceName, productId, localIfMatch, localDeleteSubscriptions, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse( + String id, String ifMatch, Boolean deleteSubscriptions, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String productId = Utils.getValueFromIdByName(id, "products"); + if (productId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + } + return this + .deleteWithResponse(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions, context); + } + + private ProductsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public ProductContractImpl define(String name) { + return new ProductContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysClientImpl.java new file mode 100644 index 0000000000000..9bc3edae6c3ab --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysClientImpl.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Patch; +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.apimanagement.fluent.QuotaByCounterKeysClient; +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterCollectionInner; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QuotaByCounterKeysClient. */ +public final class QuotaByCounterKeysClientImpl implements QuotaByCounterKeysClient { + private final ClientLogger logger = new ClientLogger(QuotaByCounterKeysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final QuotaByCounterKeysService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of QuotaByCounterKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QuotaByCounterKeysClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(QuotaByCounterKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientQuotaByCounterKeys to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientQ") + private interface QuotaByCounterKeysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/quotas/{quotaCounterKey}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("quotaCounterKey") String quotaCounterKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/quotas/{quotaCounterKey}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("quotaCounterKey") String quotaCounterKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") QuotaCounterValueUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, String quotaCounterKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceWithResponseAsync( + String resourceGroupName, String serviceName, String quotaCounterKey, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByServiceAsync( + String resourceGroupName, String serviceName, String quotaCounterKey) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaCounterCollectionInner listByService( + String resourceGroupName, String serviceName, String quotaCounterKey) { + return listByServiceAsync(resourceGroupName, serviceName, quotaCounterKey).block(); + } + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, Context context) { + return listByServiceWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey, context).block(); + } + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaCounterCollectionInner update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, quotaCounterKey, parameters).block(); + } + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey, parameters, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysImpl.java new file mode 100644 index 0000000000000..65ed5baa52903 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByCounterKeysImpl.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.apimanagement.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.apimanagement.fluent.QuotaByCounterKeysClient; +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterCollectionInner; +import com.azure.resourcemanager.apimanagement.models.QuotaByCounterKeys; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterCollection; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class QuotaByCounterKeysImpl implements QuotaByCounterKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaByCounterKeysImpl.class); + + private final QuotaByCounterKeysClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public QuotaByCounterKeysImpl( + QuotaByCounterKeysClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public QuotaCounterCollection listByService(String resourceGroupName, String serviceName, String quotaCounterKey) { + QuotaCounterCollectionInner inner = + this.serviceClient().listByService(resourceGroupName, serviceName, quotaCounterKey); + if (inner != null) { + return new QuotaCounterCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByServiceWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, Context context) { + Response inner = + this.serviceClient().listByServiceWithResponse(resourceGroupName, serviceName, quotaCounterKey, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new QuotaCounterCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QuotaCounterCollection update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters) { + QuotaCounterCollectionInner inner = + this.serviceClient().update(resourceGroupName, serviceName, quotaCounterKey, parameters); + if (inner != null) { + return new QuotaCounterCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse(resourceGroupName, serviceName, quotaCounterKey, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new QuotaCounterCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private QuotaByCounterKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysClientImpl.java new file mode 100644 index 0000000000000..be39dedf4f359 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysClientImpl.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Patch; +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.apimanagement.fluent.QuotaByPeriodKeysClient; +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterContractInner; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QuotaByPeriodKeysClient. */ +public final class QuotaByPeriodKeysClientImpl implements QuotaByPeriodKeysClient { + private final ClientLogger logger = new ClientLogger(QuotaByPeriodKeysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final QuotaByPeriodKeysService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of QuotaByPeriodKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QuotaByPeriodKeysClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(QuotaByPeriodKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientQuotaByPeriodKeys to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientQ") + private interface QuotaByPeriodKeysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("quotaCounterKey") String quotaCounterKey, + @PathParam("quotaPeriodKey") String quotaPeriodKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("quotaCounterKey") String quotaCounterKey, + @PathParam("quotaPeriodKey") String quotaPeriodKey, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") QuotaCounterValueUpdateContract parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (quotaPeriodKey == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaPeriodKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + quotaPeriodKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (quotaPeriodKey == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaPeriodKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + quotaPeriodKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey) { + return getWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaCounterContractInner get( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey) { + return getAsync(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey).block(); + } + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, context).block(); + } + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (quotaPeriodKey == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaPeriodKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + quotaPeriodKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (quotaCounterKey == null) { + return Mono + .error(new IllegalArgumentException("Parameter quotaCounterKey is required and cannot be null.")); + } + if (quotaPeriodKey == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaPeriodKey is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + quotaCounterKey, + quotaPeriodKey, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaCounterContractInner update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters) { + return updateAsync(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters).block(); + } + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters, context) + .block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysImpl.java new file mode 100644 index 0000000000000..336fa8d417495 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaByPeriodKeysImpl.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.apimanagement.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.apimanagement.fluent.QuotaByPeriodKeysClient; +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterContractInner; +import com.azure.resourcemanager.apimanagement.models.QuotaByPeriodKeys; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterContract; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueUpdateContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class QuotaByPeriodKeysImpl implements QuotaByPeriodKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaByPeriodKeysImpl.class); + + private final QuotaByPeriodKeysClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public QuotaByPeriodKeysImpl( + QuotaByPeriodKeysClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public QuotaCounterContract get( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey) { + QuotaCounterContractInner inner = + this.serviceClient().get(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey); + if (inner != null) { + return new QuotaCounterContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new QuotaCounterContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QuotaCounterContract update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters) { + QuotaCounterContractInner inner = + this.serviceClient().update(resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters); + if (inner != null) { + return new QuotaCounterContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse( + resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new QuotaCounterContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private QuotaByPeriodKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterCollectionImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterCollectionImpl.java new file mode 100644 index 0000000000000..8cbf96f01977d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterCollectionImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterContractInner; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterCollection; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterContract; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class QuotaCounterCollectionImpl implements QuotaCounterCollection { + private QuotaCounterCollectionInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + QuotaCounterCollectionImpl( + QuotaCounterCollectionInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new QuotaCounterContractImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Long count() { + return this.innerModel().count(); + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public QuotaCounterCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterContractImpl.java new file mode 100644 index 0000000000000..4d9ab5544a8b4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/QuotaCounterContractImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterContractInner; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterContract; +import com.azure.resourcemanager.apimanagement.models.QuotaCounterValueContractProperties; +import java.time.OffsetDateTime; + +public final class QuotaCounterContractImpl implements QuotaCounterContract { + private QuotaCounterContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + QuotaCounterContractImpl( + QuotaCounterContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String counterKey() { + return this.innerModel().counterKey(); + } + + public String periodKey() { + return this.innerModel().periodKey(); + } + + public OffsetDateTime periodStartTime() { + return this.innerModel().periodStartTime(); + } + + public OffsetDateTime periodEndTime() { + return this.innerModel().periodEndTime(); + } + + public QuotaCounterValueContractProperties value() { + return this.innerModel().value(); + } + + public QuotaCounterContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailCollectionImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailCollectionImpl.java new file mode 100644 index 0000000000000..0c36e8d630e54 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailCollectionImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner; +import com.azure.resourcemanager.apimanagement.models.RecipientEmailCollection; +import com.azure.resourcemanager.apimanagement.models.RecipientEmailContract; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class RecipientEmailCollectionImpl implements RecipientEmailCollection { + private RecipientEmailCollectionInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + RecipientEmailCollectionImpl( + RecipientEmailCollectionInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new RecipientEmailContractImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Long count() { + return this.innerModel().count(); + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public RecipientEmailCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailContractImpl.java new file mode 100644 index 0000000000000..7c3183779192b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientEmailContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner; +import com.azure.resourcemanager.apimanagement.models.RecipientEmailContract; + +public final class RecipientEmailContractImpl implements RecipientEmailContract { + private RecipientEmailContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + RecipientEmailContractImpl( + RecipientEmailContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 email() { + return this.innerModel().email(); + } + + public RecipientEmailContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserCollectionImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserCollectionImpl.java new file mode 100644 index 0000000000000..241359555ebe9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserCollectionImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserCollectionInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner; +import com.azure.resourcemanager.apimanagement.models.RecipientUserCollection; +import com.azure.resourcemanager.apimanagement.models.RecipientUserContract; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class RecipientUserCollectionImpl implements RecipientUserCollection { + private RecipientUserCollectionInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + RecipientUserCollectionImpl( + RecipientUserCollectionInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new RecipientUserContractImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Long count() { + return this.innerModel().count(); + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public RecipientUserCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserContractImpl.java new file mode 100644 index 0000000000000..3a3c71340293d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RecipientUserContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner; +import com.azure.resourcemanager.apimanagement.models.RecipientUserContract; + +public final class RecipientUserContractImpl implements RecipientUserContract { + private RecipientUserContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + RecipientUserContractImpl( + RecipientUserContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 userId() { + return this.innerModel().userId(); + } + + public RecipientUserContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionContractImpl.java new file mode 100644 index 0000000000000..797479befbf94 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.RegionContractInner; +import com.azure.resourcemanager.apimanagement.models.RegionContract; + +public final class RegionContractImpl implements RegionContract { + private RegionContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + RegionContractImpl( + RegionContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isMasterRegion() { + return this.innerModel().isMasterRegion(); + } + + public Boolean isDeleted() { + return this.innerModel().isDeleted(); + } + + public RegionContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsClientImpl.java new file mode 100644 index 0000000000000..6308707477d67 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsClientImpl.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.RegionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.RegionContractInner; +import com.azure.resourcemanager.apimanagement.models.RegionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegionsClient. */ +public final class RegionsClientImpl implements RegionsClient { + private final ClientLogger logger = new ClientLogger(RegionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RegionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of RegionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegionsClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(RegionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientRegions to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientR") + private interface RegionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/regions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName)); + } + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, 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 lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsImpl.java new file mode 100644 index 0000000000000..cf04f77adecb8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RegionsImpl.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.apimanagement.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.apimanagement.fluent.RegionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.RegionContractInner; +import com.azure.resourcemanager.apimanagement.models.RegionContract; +import com.azure.resourcemanager.apimanagement.models.Regions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RegionsImpl implements Regions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionsImpl.class); + + private final RegionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public RegionsImpl( + RegionsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new RegionContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new RegionContractImpl(inner1, this.manager())); + } + + private RegionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportRecordContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportRecordContractImpl.java new file mode 100644 index 0000000000000..081a36110472b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportRecordContractImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.models.ReportRecordContract; +import java.time.OffsetDateTime; + +public final class ReportRecordContractImpl implements ReportRecordContract { + private ReportRecordContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ReportRecordContractImpl( + ReportRecordContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OffsetDateTime timestamp() { + return this.innerModel().timestamp(); + } + + public String interval() { + return this.innerModel().interval(); + } + + public String country() { + return this.innerModel().country(); + } + + public String region() { + return this.innerModel().region(); + } + + public String zip() { + return this.innerModel().zip(); + } + + public String userId() { + return this.innerModel().userId(); + } + + public String productId() { + return this.innerModel().productId(); + } + + public String apiId() { + return this.innerModel().apiId(); + } + + public String operationId() { + return this.innerModel().operationId(); + } + + public String apiRegion() { + return this.innerModel().apiRegion(); + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public Integer callCountSuccess() { + return this.innerModel().callCountSuccess(); + } + + public Integer callCountBlocked() { + return this.innerModel().callCountBlocked(); + } + + public Integer callCountFailed() { + return this.innerModel().callCountFailed(); + } + + public Integer callCountOther() { + return this.innerModel().callCountOther(); + } + + public Integer callCountTotal() { + return this.innerModel().callCountTotal(); + } + + public Long bandwidth() { + return this.innerModel().bandwidth(); + } + + public Integer cacheHitCount() { + return this.innerModel().cacheHitCount(); + } + + public Integer cacheMissCount() { + return this.innerModel().cacheMissCount(); + } + + public Double apiTimeAvg() { + return this.innerModel().apiTimeAvg(); + } + + public Double apiTimeMin() { + return this.innerModel().apiTimeMin(); + } + + public Double apiTimeMax() { + return this.innerModel().apiTimeMax(); + } + + public Double serviceTimeAvg() { + return this.innerModel().serviceTimeAvg(); + } + + public Double serviceTimeMin() { + return this.innerModel().serviceTimeMin(); + } + + public Double serviceTimeMax() { + return this.innerModel().serviceTimeMax(); + } + + public ReportRecordContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsClientImpl.java new file mode 100644 index 0000000000000..5949b4587ece0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsClientImpl.java @@ -0,0 +1,3316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.ReportsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.models.ReportCollection; +import com.azure.resourcemanager.apimanagement.models.RequestReportCollection; +import java.time.Duration; +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 ApiManagementClientImpl client; + + /** + * Initializes an instance of ReportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReportsClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(ReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientReports to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientR") + private interface ReportsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byApi") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byUser") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByUser( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byOperation") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byProduct") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byGeo") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByGeo( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/bySubscription") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$orderby") String orderby, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byTime") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTime( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$orderby") String orderby, + @QueryParam("interval") Duration interval, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/reports/byRequest") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByRequest( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApiNext( + @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> listByUserNext( + @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> listByOperationNext( + @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> listByProductNext( + @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> listByGeoNext( + @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> listBySubscriptionNext( + @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> listByTimeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context), + nextLink -> listByApiNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, filter, top, skip, orderby)); + } + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context)); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByUser( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByUser( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + return new PagedFlux<>( + () -> listByUserSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByUserNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByUserSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByUserNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByUserAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listByUserSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context), + nextLink -> listByUserNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByUser( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedIterable<>(listByUserAsync(resourceGroupName, serviceName, filter, top, skip, orderby)); + } + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByUser( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedIterable<>( + listByUserAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context)); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOperationAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + return new PagedFlux<>( + () -> listByOperationSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByOperationNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOperationAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByOperationSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByOperationNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOperationAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listByOperationSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context), + nextLink -> listByOperationNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOperation( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedIterable<>(listByOperationAsync(resourceGroupName, serviceName, filter, top, skip, orderby)); + } + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedIterable<>( + listByOperationAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context)); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context), + nextLink -> listByProductNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedIterable<>(listByProductAsync(resourceGroupName, serviceName, filter, top, skip, orderby)); + } + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedIterable<>( + listByProductAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context)); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGeoSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByGeo( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGeoSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGeo( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGeoAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByGeoSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByGeoNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGeoAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByGeoSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByGeoNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGeoAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByGeoSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByGeoNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGeo( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByGeoAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGeo( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByGeoAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySubscription( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscription( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String orderby) { + return new PagedFlux<>( + () -> listBySubscriptionSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedFlux<>( + () -> listBySubscriptionSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedFlux<>( + () -> + listBySubscriptionSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedIterable<>(listBySubscriptionAsync(resourceGroupName, serviceName, filter, top, skip, orderby)); + } + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedIterable<>( + listBySubscriptionAsync(resourceGroupName, serviceName, filter, top, skip, orderby, context)); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTimeSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (interval == null) { + return Mono.error(new IllegalArgumentException("Parameter interval is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTime( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + interval, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTimeSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (interval == null) { + return Mono.error(new IllegalArgumentException("Parameter interval is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTime( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + orderby, + interval, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTimeAsync( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby) { + return new PagedFlux<>( + () -> listByTimeSinglePageAsync(resourceGroupName, serviceName, filter, interval, top, skip, orderby), + nextLink -> listByTimeNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTimeAsync( + String resourceGroupName, String serviceName, String filter, Duration interval) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedFlux<>( + () -> listByTimeSinglePageAsync(resourceGroupName, serviceName, filter, interval, top, skip, orderby), + nextLink -> listByTimeNextSinglePageAsync(nextLink)); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTimeAsync( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedFlux<>( + () -> + listByTimeSinglePageAsync( + resourceGroupName, serviceName, filter, interval, top, skip, orderby, context), + nextLink -> listByTimeNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTime( + String resourceGroupName, String serviceName, String filter, Duration interval) { + final Integer top = null; + final Integer skip = null; + final String orderby = null; + return new PagedIterable<>( + listByTimeAsync(resourceGroupName, serviceName, filter, interval, top, skip, orderby)); + } + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTime( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby, + Context context) { + return new PagedIterable<>( + listByTimeAsync(resourceGroupName, serviceName, filter, interval, top, skip, orderby, context)); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRequestSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByRequest( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByRequestSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByRequest( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRequestAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>(() -> listByRequestSinglePageAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRequestAsync( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>(() -> listByRequestSinglePageAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByRequestAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByRequestSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter) { + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByRequestAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByRequestAsync(resourceGroupName, serviceName, filter, top, skip, 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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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.listByApiNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync( + 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 + .listByApiNext(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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserNextSinglePageAsync(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.listByUserNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByUserNextSinglePageAsync( + 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 + .listByUserNext(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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationNextSinglePageAsync(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.listByOperationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationNextSinglePageAsync( + 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 + .listByOperationNext(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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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.listByProductNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync( + 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 + .listByProductNext(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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGeoNextSinglePageAsync(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.listByGeoNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGeoNextSinglePageAsync( + 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 + .listByGeoNext(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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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 paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTimeNextSinglePageAsync(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.listByTimeNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTimeNextSinglePageAsync( + 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 + .listByTimeNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsImpl.java new file mode 100644 index 0000000000000..b2fc3bd6f7744 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ReportsImpl.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.apimanagement.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.apimanagement.fluent.ReportsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.ReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.models.ReportRecordContract; +import com.azure.resourcemanager.apimanagement.models.Reports; +import com.azure.resourcemanager.apimanagement.models.RequestReportRecordContract; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.time.Duration; + +public final class ReportsImpl implements Reports { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReportsImpl.class); + + private final ReportsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public ReportsImpl( + ReportsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByApi(String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, filter, top, skip, orderby, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByUser(String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listByUser(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByUser( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().listByUser(resourceGroupName, serviceName, filter, top, skip, orderby, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByOperation( + String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listByOperation(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().listByOperation(resourceGroupName, serviceName, filter, top, skip, orderby, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByProduct( + String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, filter, top, skip, orderby, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByGeo(String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listByGeo(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByGeo( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByGeo(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription( + String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listBySubscription(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listBySubscription(resourceGroupName, serviceName, filter, top, skip, orderby, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByTime( + String resourceGroupName, String serviceName, String filter, Duration interval) { + PagedIterable inner = + this.serviceClient().listByTime(resourceGroupName, serviceName, filter, interval); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByTime( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByTime(resourceGroupName, serviceName, filter, interval, top, skip, orderby, context); + return Utils.mapPage(inner, inner1 -> new ReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter) { + PagedIterable inner = + this.serviceClient().listByRequest(resourceGroupName, serviceName, filter); + return Utils.mapPage(inner, inner1 -> new RequestReportRecordContractImpl(inner1, this.manager())); + } + + public PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByRequest(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new RequestReportRecordContractImpl(inner1, this.manager())); + } + + private ReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RequestReportRecordContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RequestReportRecordContractImpl.java new file mode 100644 index 0000000000000..c726c0318ac90 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/RequestReportRecordContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner; +import com.azure.resourcemanager.apimanagement.models.RequestReportRecordContract; +import java.time.OffsetDateTime; + +public final class RequestReportRecordContractImpl implements RequestReportRecordContract { + private RequestReportRecordContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + RequestReportRecordContractImpl( + RequestReportRecordContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String apiId() { + return this.innerModel().apiId(); + } + + public String operationId() { + return this.innerModel().operationId(); + } + + public String productId() { + return this.innerModel().productId(); + } + + public String userId() { + return this.innerModel().userId(); + } + + public String method() { + return this.innerModel().method(); + } + + public String url() { + return this.innerModel().url(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public String backendResponseCode() { + return this.innerModel().backendResponseCode(); + } + + public Integer responseCode() { + return this.innerModel().responseCode(); + } + + public Integer responseSize() { + return this.innerModel().responseSize(); + } + + public OffsetDateTime timestamp() { + return this.innerModel().timestamp(); + } + + public String cache() { + return this.innerModel().cache(); + } + + public Double apiTime() { + return this.innerModel().apiTime(); + } + + public Double serviceTime() { + return this.innerModel().serviceTime(); + } + + public String apiRegion() { + return this.innerModel().apiRegion(); + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String requestId() { + return this.innerModel().requestId(); + } + + public Integer requestSize() { + return this.innerModel().requestSize(); + } + + public RequestReportRecordContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ResourceSkuResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ResourceSkuResultImpl.java new file mode 100644 index 0000000000000..c61e31a2215e4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ResourceSkuResultImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.ResourceSkuResultInner; +import com.azure.resourcemanager.apimanagement.models.ResourceSku; +import com.azure.resourcemanager.apimanagement.models.ResourceSkuCapacity; +import com.azure.resourcemanager.apimanagement.models.ResourceSkuResult; + +public final class ResourceSkuResultImpl implements ResourceSkuResult { + private ResourceSkuResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + ResourceSkuResultImpl( + ResourceSkuResultInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public ResourceSku sku() { + return this.innerModel().sku(); + } + + public ResourceSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public ResourceSkuResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SchemaContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SchemaContractImpl.java new file mode 100644 index 0000000000000..6a6986ddca03a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SchemaContractImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; +import com.azure.resourcemanager.apimanagement.models.SchemaContract; + +public final class SchemaContractImpl implements SchemaContract, SchemaContract.Definition, SchemaContract.Update { + private SchemaContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String contentType() { + return this.innerModel().contentType(); + } + + public String value() { + return this.innerModel().value(); + } + + public Object definitions() { + return this.innerModel().definitions(); + } + + public SchemaContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String schemaId; + + private String createIfMatch; + + private String updateIfMatch; + + public SchemaContractImpl withExistingApi(String resourceGroupName, String serviceName, String apiId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + return this; + } + + public SchemaContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiSchemas() + .createOrUpdate( + resourceGroupName, serviceName, apiId, schemaId, this.innerModel(), createIfMatch, Context.NONE); + return this; + } + + public SchemaContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiSchemas() + .createOrUpdate( + resourceGroupName, serviceName, apiId, schemaId, this.innerModel(), createIfMatch, context); + return this; + } + + SchemaContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new SchemaContractInner(); + this.serviceManager = serviceManager; + this.schemaId = name; + this.createIfMatch = null; + } + + public SchemaContractImpl update() { + this.updateIfMatch = null; + return this; + } + + public SchemaContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiSchemas() + .createOrUpdate( + resourceGroupName, serviceName, apiId, schemaId, this.innerModel(), updateIfMatch, Context.NONE); + return this; + } + + public SchemaContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiSchemas() + .createOrUpdate( + resourceGroupName, serviceName, apiId, schemaId, this.innerModel(), updateIfMatch, context); + return this; + } + + SchemaContractImpl( + SchemaContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.schemaId = Utils.getValueFromIdByName(innerObject.id(), "schemas"); + } + + public SchemaContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiSchemas() + .getWithResponse(resourceGroupName, serviceName, apiId, schemaId, Context.NONE) + .getValue(); + return this; + } + + public SchemaContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiSchemas() + .getWithResponse(resourceGroupName, serviceName, apiId, schemaId, context) + .getValue(); + return this; + } + + public SchemaContractImpl withContentType(String contentType) { + this.innerModel().withContentType(contentType); + return this; + } + + public SchemaContractImpl withValue(String value) { + this.innerModel().withValue(value); + return this; + } + + public SchemaContractImpl withDefinitions(Object definitions) { + this.innerModel().withDefinitions(definitions); + return this; + } + + public SchemaContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsClientImpl.java new file mode 100644 index 0000000000000..e2ca774b615bb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsClientImpl.java @@ -0,0 +1,810 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.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.apimanagement.fluent.SignInSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; +import com.azure.resourcemanager.apimanagement.models.SignInSettingsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.SignInSettingsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SignInSettingsClient. */ +public final class SignInSettingsClientImpl implements SignInSettingsClient { + private final ClientLogger logger = new ClientLogger(SignInSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SignInSettingsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of SignInSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SignInSettingsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(SignInSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientSignInSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientS") + private interface SignInSettingsService { + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signin") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signin") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signin") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalSigninSettingsInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signin") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalSigninSettingsInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignInSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignInSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignInSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName) + .flatMap((SignInSettingsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName) { + getEntityTagAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignInSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName) { + return getWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (SignInSettingsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalSigninSettingsInner get(String resourceGroupName, String serviceName) { + return getAsync(resourceGroupName, serviceName).block(); + } + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, String serviceName, String ifMatch, PortalSigninSettingsInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSigninSettingsInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync( + String resourceGroupName, String serviceName, String ifMatch, PortalSigninSettingsInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, ifMatch, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 update( + String resourceGroupName, String serviceName, String ifMatch, PortalSigninSettingsInner parameters) { + updateAsync(resourceGroupName, serviceName, ifMatch, parameters).block(); + } + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSigninSettingsInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, ifMatch, parameters, context).block(); + } + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + PortalSigninSettingsInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalSigninSettingsInner createOrUpdate( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, parameters, ifMatch).block(); + } + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSigninSettingsInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsImpl.java new file mode 100644 index 0000000000000..b7241f4485db1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignInSettingsImpl.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.apimanagement.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.apimanagement.fluent.SignInSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; +import com.azure.resourcemanager.apimanagement.models.PortalSigninSettings; +import com.azure.resourcemanager.apimanagement.models.SignInSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SignInSettingsImpl implements SignInSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignInSettingsImpl.class); + + private final SignInSettingsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public SignInSettingsImpl( + SignInSettingsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void getEntityTag(String resourceGroupName, String serviceName) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName); + } + + public Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, context); + } + + public PortalSigninSettings get(String resourceGroupName, String serviceName) { + PortalSigninSettingsInner inner = this.serviceClient().get(resourceGroupName, serviceName); + if (inner != null) { + return new PortalSigninSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalSigninSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void update( + String resourceGroupName, String serviceName, String ifMatch, PortalSigninSettingsInner parameters) { + this.serviceClient().update(resourceGroupName, serviceName, ifMatch, parameters); + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSigninSettingsInner parameters, + Context context) { + return this.serviceClient().updateWithResponse(resourceGroupName, serviceName, ifMatch, parameters, context); + } + + public PortalSigninSettings createOrUpdate( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters) { + PortalSigninSettingsInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, parameters); + if (inner != null) { + return new PortalSigninSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSigninSettingsInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalSigninSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SignInSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsClientImpl.java new file mode 100644 index 0000000000000..5a85b33ea72b4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsClientImpl.java @@ -0,0 +1,810 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +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.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.apimanagement.fluent.SignUpSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner; +import com.azure.resourcemanager.apimanagement.models.SignUpSettingsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.SignUpSettingsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SignUpSettingsClient. */ +public final class SignUpSettingsClientImpl implements SignUpSettingsClient { + private final ClientLogger logger = new ClientLogger(SignUpSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SignUpSettingsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of SignUpSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SignUpSettingsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(SignUpSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientSignUpSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientS") + private interface SignUpSettingsService { + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signup") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalSignupSettingsInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/portalsettings/signup") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PortalSignupSettingsInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignUpSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignUpSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignUpSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName) + .flatMap((SignUpSettingsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName) { + getEntityTagAsync(resourceGroupName, serviceName).block(); + } + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignUpSettings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName) { + return getWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (SignUpSettingsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalSignupSettingsInner get(String resourceGroupName, String serviceName) { + return getAsync(resourceGroupName, serviceName).block(); + } + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, String serviceName, String ifMatch, PortalSignupSettingsInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSignupSettingsInner 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync( + String resourceGroupName, String serviceName, String ifMatch, PortalSignupSettingsInner parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, ifMatch, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 update( + String resourceGroupName, String serviceName, String ifMatch, PortalSignupSettingsInner parameters) { + updateAsync(resourceGroupName, serviceName, ifMatch, parameters).block(); + } + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSignupSettingsInner parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, ifMatch, parameters, context).block(); + } + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + PortalSignupSettingsInner parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters, String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PortalSignupSettingsInner createOrUpdate( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, parameters, ifMatch).block(); + } + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSignupSettingsInner parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, parameters, ifMatch, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsImpl.java new file mode 100644 index 0000000000000..01297e64ac90c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SignUpSettingsImpl.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.apimanagement.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.apimanagement.fluent.SignUpSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner; +import com.azure.resourcemanager.apimanagement.models.PortalSignupSettings; +import com.azure.resourcemanager.apimanagement.models.SignUpSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SignUpSettingsImpl implements SignUpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignUpSettingsImpl.class); + + private final SignUpSettingsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public SignUpSettingsImpl( + SignUpSettingsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void getEntityTag(String resourceGroupName, String serviceName) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName); + } + + public Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, context); + } + + public PortalSignupSettings get(String resourceGroupName, String serviceName) { + PortalSignupSettingsInner inner = this.serviceClient().get(resourceGroupName, serviceName); + if (inner != null) { + return new PortalSignupSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalSignupSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void update( + String resourceGroupName, String serviceName, String ifMatch, PortalSignupSettingsInner parameters) { + this.serviceClient().update(resourceGroupName, serviceName, ifMatch, parameters); + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSignupSettingsInner parameters, + Context context) { + return this.serviceClient().updateWithResponse(resourceGroupName, serviceName, ifMatch, parameters, context); + } + + public PortalSignupSettings createOrUpdate( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters) { + PortalSignupSettingsInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, parameters); + if (inner != null) { + return new PortalSignupSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSignupSettingsInner parameters, + String ifMatch, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse(resourceGroupName, serviceName, parameters, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PortalSignupSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SignUpSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionContractImpl.java new file mode 100644 index 0000000000000..bb76b8fb5f663 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionContractImpl.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.SubscriptionContract; +import com.azure.resourcemanager.apimanagement.models.SubscriptionState; +import java.time.OffsetDateTime; + +public final class SubscriptionContractImpl implements SubscriptionContract { + private SubscriptionContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + SubscriptionContractImpl( + SubscriptionContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 ownerId() { + return this.innerModel().ownerId(); + } + + public String scope() { + return this.innerModel().scope(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public SubscriptionState state() { + return this.innerModel().state(); + } + + public OffsetDateTime createdDate() { + return this.innerModel().createdDate(); + } + + public OffsetDateTime startDate() { + return this.innerModel().startDate(); + } + + public OffsetDateTime expirationDate() { + return this.innerModel().expirationDate(); + } + + public OffsetDateTime endDate() { + return this.innerModel().endDate(); + } + + public OffsetDateTime notificationDate() { + return this.innerModel().notificationDate(); + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public String stateComment() { + return this.innerModel().stateComment(); + } + + public Boolean allowTracing() { + return this.innerModel().allowTracing(); + } + + public SubscriptionContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionKeysContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionKeysContractImpl.java new file mode 100644 index 0000000000000..013e5612cd842 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionKeysContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner; +import com.azure.resourcemanager.apimanagement.models.SubscriptionKeysContract; + +public final class SubscriptionKeysContractImpl implements SubscriptionKeysContract { + private SubscriptionKeysContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + SubscriptionKeysContractImpl( + SubscriptionKeysContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public SubscriptionKeysContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsClientImpl.java new file mode 100644 index 0000000000000..f2f7c4c55959c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsClientImpl.java @@ -0,0 +1,2140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.SubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.SubscriptionCollection; +import com.azure.resourcemanager.apimanagement.models.SubscriptionCreateParameters; +import com.azure.resourcemanager.apimanagement.models.SubscriptionUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsGetResponse; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsListSecretsResponse; +import com.azure.resourcemanager.apimanagement.models.SubscriptionsUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SubscriptionsClient. */ +public final class SubscriptionsClientImpl implements SubscriptionsClient { + private final ClientLogger logger = new ClientLogger(SubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SubscriptionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of SubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(SubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientSubscriptions to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientS") + private interface SubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("notify") Boolean notify, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("appType") AppType appType, + @BodyParam("application/json") SubscriptionCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("notify") Boolean notify, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("appType") AppType appType, + @BodyParam("application/json") SubscriptionUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regeneratePrimaryKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateSecondaryKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/subscriptions/{sid}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listSecrets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("sid") String sid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, filter, top, skip, context)); + } + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the apimanagement subscription specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String sid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the apimanagement subscription specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String sid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the apimanagement subscription specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String sid) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, sid) + .flatMap((SubscriptionsGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String sid) { + getEntityTagAsync(resourceGroupName, serviceName, sid).block(); + } + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the apimanagement subscription specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, sid, context).block(); + } + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String sid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String sid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String sid) { + return getWithResponseAsync(resourceGroupName, serviceName, sid) + .flatMap( + (SubscriptionsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionContractInner get(String resourceGroupName, String serviceName, String sid) { + return getAsync(resourceGroupName, serviceName, sid).block(); + } + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, sid, context).block(); + } + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + parameters, + accept, + context); + } + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, sid, parameters, notify, ifMatch, appType) + .flatMap( + (SubscriptionsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String sid, SubscriptionCreateParameters parameters) { + final Boolean notify = null; + final String ifMatch = null; + final AppType appType = null; + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, sid, parameters, notify, ifMatch, appType) + .flatMap( + (SubscriptionsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionContractInner createOrUpdate( + String resourceGroupName, String serviceName, String sid, SubscriptionCreateParameters parameters) { + final Boolean notify = null; + final String ifMatch = null; + final AppType appType = null; + return createOrUpdateAsync(resourceGroupName, serviceName, sid, parameters, notify, ifMatch, appType).block(); + } + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, sid, parameters, notify, ifMatch, appType, context) + .block(); + } + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + parameters, + accept, + context); + } + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType) { + return updateWithResponseAsync(resourceGroupName, serviceName, sid, ifMatch, parameters, notify, appType) + .flatMap( + (SubscriptionsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters) { + final Boolean notify = null; + final AppType appType = null; + return updateWithResponseAsync(resourceGroupName, serviceName, sid, ifMatch, parameters, notify, appType) + .flatMap( + (SubscriptionsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionContractInner update( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters) { + final Boolean notify = null; + final AppType appType = null; + return updateAsync(resourceGroupName, serviceName, sid, ifMatch, parameters, notify, appType).block(); + } + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType, + Context context) { + return updateWithResponseAsync( + resourceGroupName, serviceName, sid, ifMatch, parameters, notify, appType, context) + .block(); + } + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String sid, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String sid, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String sid, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, sid, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String sid, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, sid, ifMatch).block(); + } + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String sid, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, sid, ifMatch, context).block(); + } + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> regeneratePrimaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, String sid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regeneratePrimaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> regeneratePrimaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, String sid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regeneratePrimaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 regeneratePrimaryKeyAsync(String resourceGroupName, String serviceName, String sid) { + return regeneratePrimaryKeyWithResponseAsync(resourceGroupName, serviceName, sid) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 regeneratePrimaryKey(String resourceGroupName, String serviceName, String sid) { + regeneratePrimaryKeyAsync(resourceGroupName, serviceName, sid).block(); + } + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return regeneratePrimaryKeyWithResponseAsync(resourceGroupName, serviceName, sid, context).block(); + } + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> regenerateSecondaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, String sid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateSecondaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> regenerateSecondaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, String sid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateSecondaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 regenerateSecondaryKeyAsync(String resourceGroupName, String serviceName, String sid) { + return regenerateSecondaryKeyWithResponseAsync(resourceGroupName, serviceName, sid) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 regenerateSecondaryKey(String resourceGroupName, String serviceName, String sid) { + regenerateSecondaryKeyAsync(resourceGroupName, serviceName, sid).block(); + } + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return regenerateSecondaryKeyWithResponseAsync(resourceGroupName, serviceName, sid, context).block(); + } + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String sid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String sid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String serviceName, String sid) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, sid) + .flatMap( + (SubscriptionsListSecretsResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionKeysContractInner listSecrets(String resourceGroupName, String serviceName, String sid) { + return listSecretsAsync(resourceGroupName, serviceName, sid).block(); + } + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, sid, 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 paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsImpl.java new file mode 100644 index 0000000000000..946e0b18d6b33 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/SubscriptionsImpl.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.apimanagement.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.apimanagement.fluent.SubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.SubscriptionContract; +import com.azure.resourcemanager.apimanagement.models.SubscriptionCreateParameters; +import com.azure.resourcemanager.apimanagement.models.SubscriptionKeysContract; +import com.azure.resourcemanager.apimanagement.models.SubscriptionUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.Subscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SubscriptionsImpl implements Subscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsImpl.class); + + private final SubscriptionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public SubscriptionsImpl( + SubscriptionsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new SubscriptionContractImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new SubscriptionContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String sid) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, sid); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, sid, context); + } + + public SubscriptionContract get(String resourceGroupName, String serviceName, String sid) { + SubscriptionContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, sid); + if (inner != null) { + return new SubscriptionContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, sid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubscriptionContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SubscriptionContract createOrUpdate( + String resourceGroupName, String serviceName, String sid, SubscriptionCreateParameters parameters) { + SubscriptionContractInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, sid, parameters); + if (inner != null) { + return new SubscriptionContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, sid, parameters, notify, ifMatch, appType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubscriptionContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SubscriptionContract update( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters) { + SubscriptionContractInner inner = + this.serviceClient().update(resourceGroupName, serviceName, sid, ifMatch, parameters); + if (inner != null) { + return new SubscriptionContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse(resourceGroupName, serviceName, sid, ifMatch, parameters, notify, appType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubscriptionContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String sid, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, sid, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String sid, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, sid, ifMatch, context); + } + + public void regeneratePrimaryKey(String resourceGroupName, String serviceName, String sid) { + this.serviceClient().regeneratePrimaryKey(resourceGroupName, serviceName, sid); + } + + public Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return this.serviceClient().regeneratePrimaryKeyWithResponse(resourceGroupName, serviceName, sid, context); + } + + public void regenerateSecondaryKey(String resourceGroupName, String serviceName, String sid) { + this.serviceClient().regenerateSecondaryKey(resourceGroupName, serviceName, sid); + } + + public Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + return this.serviceClient().regenerateSecondaryKeyWithResponse(resourceGroupName, serviceName, sid, context); + } + + public SubscriptionKeysContract listSecrets(String resourceGroupName, String serviceName, String sid) { + SubscriptionKeysContractInner inner = this.serviceClient().listSecrets(resourceGroupName, serviceName, sid); + if (inner != null) { + return new SubscriptionKeysContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String sid, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, serviceName, sid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubscriptionKeysContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagContractImpl.java new file mode 100644 index 0000000000000..9641541087529 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagContractImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; +import com.azure.resourcemanager.apimanagement.models.TagContract; +import com.azure.resourcemanager.apimanagement.models.TagCreateUpdateParameters; + +public final class TagContractImpl implements TagContract, TagContract.Definition, TagContract.Update { + private TagContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public TagContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String tagId; + + private String createIfMatch; + + private TagCreateUpdateParameters createParameters; + + private String updateIfMatch; + + private TagCreateUpdateParameters updateParameters; + + public TagContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public TagContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getTags() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, tagId, createParameters, createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public TagContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTags() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, tagId, createParameters, createIfMatch, context) + .getValue(); + return this; + } + + TagContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new TagContractInner(); + this.serviceManager = serviceManager; + this.tagId = name; + this.createIfMatch = null; + this.createParameters = new TagCreateUpdateParameters(); + } + + public TagContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new TagCreateUpdateParameters(); + return this; + } + + public TagContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTags() + .updateWithResponse( + resourceGroupName, serviceName, tagId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public TagContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTags() + .updateWithResponse(resourceGroupName, serviceName, tagId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + TagContractImpl( + TagContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.tagId = Utils.getValueFromIdByName(innerObject.id(), "tags"); + } + + public TagContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTags() + .getWithResponse(resourceGroupName, serviceName, tagId, Context.NONE) + .getValue(); + return this; + } + + public TagContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTags() + .getWithResponse(resourceGroupName, serviceName, tagId, context) + .getValue(); + return this; + } + + public TagContractImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.createParameters.withDisplayName(displayName); + return this; + } else { + this.updateParameters.withDisplayName(displayName); + return this; + } + } + + public TagContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagDescriptionContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagDescriptionContractImpl.java new file mode 100644 index 0000000000000..5757c427376e5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagDescriptionContractImpl.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.apimanagement.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.TagDescriptionContract; +import com.azure.resourcemanager.apimanagement.models.TagDescriptionCreateParameters; + +public final class TagDescriptionContractImpl + implements TagDescriptionContract, TagDescriptionContract.Definition, TagDescriptionContract.Update { + private TagDescriptionContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public String externalDocsUrl() { + return this.innerModel().externalDocsUrl(); + } + + public String externalDocsDescription() { + return this.innerModel().externalDocsDescription(); + } + + public String tagId() { + return this.innerModel().tagId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public TagDescriptionContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiId; + + private String tagDescriptionId; + + private String createIfMatch; + + private TagDescriptionCreateParameters createParameters; + + private String updateIfMatch; + + private TagDescriptionCreateParameters updateParameters; + + public TagDescriptionContractImpl withExistingApi(String resourceGroupName, String serviceName, String apiId) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiId = apiId; + return this; + } + + public TagDescriptionContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiTagDescriptions() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + createParameters, + createIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public TagDescriptionContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiTagDescriptions() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, tagDescriptionId, createParameters, createIfMatch, context) + .getValue(); + return this; + } + + TagDescriptionContractImpl( + String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new TagDescriptionContractInner(); + this.serviceManager = serviceManager; + this.tagDescriptionId = name; + this.createIfMatch = null; + this.createParameters = new TagDescriptionCreateParameters(); + } + + public TagDescriptionContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new TagDescriptionCreateParameters(); + return this; + } + + public TagDescriptionContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiTagDescriptions() + .createOrUpdateWithResponse( + resourceGroupName, + serviceName, + apiId, + tagDescriptionId, + updateParameters, + updateIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public TagDescriptionContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiTagDescriptions() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, apiId, tagDescriptionId, updateParameters, updateIfMatch, context) + .getValue(); + return this; + } + + TagDescriptionContractImpl( + TagDescriptionContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.apiId = Utils.getValueFromIdByName(innerObject.id(), "apis"); + this.tagDescriptionId = Utils.getValueFromIdByName(innerObject.id(), "tagDescriptions"); + } + + public TagDescriptionContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiTagDescriptions() + .getWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, Context.NONE) + .getValue(); + return this; + } + + public TagDescriptionContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiTagDescriptions() + .getWithResponse(resourceGroupName, serviceName, apiId, tagDescriptionId, context) + .getValue(); + return this; + } + + public TagDescriptionContractImpl withDescription(String description) { + if (isInCreateMode()) { + this.createParameters.withDescription(description); + return this; + } else { + this.updateParameters.withDescription(description); + return this; + } + } + + public TagDescriptionContractImpl withExternalDocsUrl(String externalDocsUrl) { + if (isInCreateMode()) { + this.createParameters.withExternalDocsUrl(externalDocsUrl); + return this; + } else { + this.updateParameters.withExternalDocsUrl(externalDocsUrl); + return this; + } + } + + public TagDescriptionContractImpl withExternalDocsDescription(String externalDocsDescription) { + if (isInCreateMode()) { + this.createParameters.withExternalDocsDescription(externalDocsDescription); + return this; + } else { + this.updateParameters.withExternalDocsDescription(externalDocsDescription); + return this; + } + } + + public TagDescriptionContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourceContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourceContractImpl.java new file mode 100644 index 0000000000000..da7a2878bb674 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourceContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.ApiTagResourceContractProperties; +import com.azure.resourcemanager.apimanagement.models.OperationTagResourceContractProperties; +import com.azure.resourcemanager.apimanagement.models.ProductTagResourceContractProperties; +import com.azure.resourcemanager.apimanagement.models.TagResourceContract; +import com.azure.resourcemanager.apimanagement.models.TagResourceContractProperties; + +public final class TagResourceContractImpl implements TagResourceContract { + private TagResourceContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + TagResourceContractImpl( + TagResourceContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public TagResourceContractProperties tag() { + return this.innerModel().tag(); + } + + public ApiTagResourceContractProperties api() { + return this.innerModel().api(); + } + + public OperationTagResourceContractProperties operation() { + return this.innerModel().operation(); + } + + public ProductTagResourceContractProperties product() { + return this.innerModel().product(); + } + + public TagResourceContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesClientImpl.java new file mode 100644 index 0000000000000..6cbdf8f0641d2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesClientImpl.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.TagResourcesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.TagResourceCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TagResourcesClient. */ +public final class TagResourcesClientImpl implements TagResourcesClient { + private final ClientLogger logger = new ClientLogger(TagResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TagResourcesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of TagResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TagResourcesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(TagResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientTagResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientT") + private interface TagResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tagResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip)); + } + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, 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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesImpl.java new file mode 100644 index 0000000000000..51779bdeb09c8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagResourcesImpl.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.apimanagement.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.apimanagement.fluent.TagResourcesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.azure.resourcemanager.apimanagement.models.TagResourceContract; +import com.azure.resourcemanager.apimanagement.models.TagResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TagResourcesImpl implements TagResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagResourcesImpl.class); + + private final TagResourcesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public TagResourcesImpl( + TagResourcesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new TagResourceContractImpl(inner1, this.manager())); + } + + private TagResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsClientImpl.java new file mode 100644 index 0000000000000..b2d5fed89b853 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsClientImpl.java @@ -0,0 +1,5047 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.TagsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; +import com.azure.resourcemanager.apimanagement.models.TagCollection; +import com.azure.resourcemanager.apimanagement.models.TagCreateUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.TagsAssignToApiResponse; +import com.azure.resourcemanager.apimanagement.models.TagsCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetByApiResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetByOperationResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetByProductResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetEntityStateByApiResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetEntityStateByOperationResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetEntityStateByProductResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetEntityStateResponse; +import com.azure.resourcemanager.apimanagement.models.TagsGetResponse; +import com.azure.resourcemanager.apimanagement.models.TagsUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TagsClient. */ +public final class TagsClientImpl implements TagsClient { + private final ClientLogger logger = new ClientLogger(TagsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TagsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of TagsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TagsClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(TagsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientTags to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientT") + private interface TagsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityStateByOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getByOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> assignToOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> detachFromOperation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("operationId") String operationId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityStateByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getByApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tags/{tagId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono assignToApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/apis/{apiId}/tags/{tagId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> detachFromApi( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/tags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityStateByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getByProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/tags/{tagId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> assignToProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/products/{productId}/tags/{tagId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> detachFromProduct( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("productId") String productId, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tags") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("scope") String scope, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityState( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("tagId") String tagId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tags/{tagId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("tagId") String tagId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagCreateUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tags/{tagId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("tagId") String tagId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") TagCreateUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tags/{tagId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("tagId") String tagId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByOperationNext( + @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> listByApiNext( + @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> listByProductNext( + @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> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOperationAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip) { + return new PagedFlux<>( + () -> listByOperationSinglePageAsync(resourceGroupName, serviceName, apiId, operationId, filter, top, skip), + nextLink -> listByOperationNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOperationAsync( + String resourceGroupName, String serviceName, String apiId, String operationId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByOperationSinglePageAsync(resourceGroupName, serviceName, apiId, operationId, filter, top, skip), + nextLink -> listByOperationNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByOperationAsync( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> + listByOperationSinglePageAsync( + resourceGroupName, serviceName, apiId, operationId, filter, top, skip, context), + nextLink -> listByOperationNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>( + listByOperationAsync(resourceGroupName, serviceName, apiId, operationId, filter, top, skip)); + } + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByOperationAsync(resourceGroupName, serviceName, apiId, operationId, filter, top, skip, context)); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityStateByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityStateByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByOperationAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + return getEntityStateByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId) + .flatMap((TagsGetEntityStateByOperationResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityStateByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + getEntityStateByOperationAsync(resourceGroupName, serviceName, apiId, operationId, tagId).block(); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityStateByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + return getEntityStateByOperationWithResponseAsync( + resourceGroupName, serviceName, apiId, operationId, tagId, context) + .block(); + } + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByOperationAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + return getByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId) + .flatMap( + (TagsGetByOperationResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner getByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + return getByOperationAsync(resourceGroupName, serviceName, apiId, operationId, tagId).block(); + } + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + return getByOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId, context) + .block(); + } + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> assignToOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assignToOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> assignToOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .assignToOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assignToOperationAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + return assignToOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner assignToOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + return assignToOperationAsync(resourceGroupName, serviceName, apiId, operationId, tagId).block(); + } + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response assignToOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + return assignToOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId, context) + .block(); + } + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> detachFromOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachFromOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> detachFromOperationWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachFromOperation( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + operationId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFromOperationAsync( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + return detachFromOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFromOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + detachFromOperationAsync(resourceGroupName, serviceName, apiId, operationId, tagId).block(); + } + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detachFromOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + return detachFromOperationWithResponseAsync(resourceGroupName, serviceName, apiId, operationId, tagId, context) + .block(); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiSinglePageAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, String serviceName, String apiId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip), + nextLink -> listByApiNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByApiAsync( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByApiSinglePageAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context), + nextLink -> listByApiNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, apiId, filter, top, skip)); + } + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listByApiAsync(resourceGroupName, serviceName, apiId, filter, top, skip, context)); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityStateByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityStateByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByApiAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + return getEntityStateByApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId) + .flatMap((TagsGetEntityStateByApiResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityStateByApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + getEntityStateByApiAsync(resourceGroupName, serviceName, apiId, tagId).block(); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityStateByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + return getEntityStateByApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId, context).block(); + } + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByApiAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + return getByApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId) + .flatMap( + (TagsGetByApiResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner getByApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + return getByApiAsync(resourceGroupName, serviceName, apiId, tagId).block(); + } + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + return getByApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId, context).block(); + } + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assignToApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assignToApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assignToApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .assignToApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assignToApiAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + return assignToApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId) + .flatMap( + (TagsAssignToApiResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner assignToApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + return assignToApiAsync(resourceGroupName, serviceName, apiId, tagId).block(); + } + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response assignToApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + return assignToApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId, context).block(); + } + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> detachFromApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachFromApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> detachFromApiWithResponseAsync( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiId == null) { + return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachFromApi( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + apiId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFromApiAsync(String resourceGroupName, String serviceName, String apiId, String tagId) { + return detachFromApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFromApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + detachFromApiAsync(resourceGroupName, serviceName, apiId, tagId).block(); + } + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detachFromApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + return detachFromApiWithResponseAsync(resourceGroupName, serviceName, apiId, tagId, context).block(); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductSinglePageAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String productId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip), + nextLink -> listByProductNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByProductAsync( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listByProductSinglePageAsync(resourceGroupName, serviceName, productId, filter, top, skip, context), + nextLink -> listByProductNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, String serviceName, String productId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listByProductAsync(resourceGroupName, serviceName, productId, filter, top, skip)); + } + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>( + listByProductAsync(resourceGroupName, serviceName, productId, filter, top, skip, context)); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityStateByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityStateByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateByProductAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + return getEntityStateByProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId) + .flatMap((TagsGetEntityStateByProductResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityStateByProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + getEntityStateByProductAsync(resourceGroupName, serviceName, productId, tagId).block(); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityStateByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + return getEntityStateByProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId, context) + .block(); + } + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByProductAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + return getByProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId) + .flatMap( + (TagsGetByProductResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner getByProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + return getByProductAsync(resourceGroupName, serviceName, productId, tagId).block(); + } + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + return getByProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId, context).block(); + } + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> assignToProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .assignToProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> assignToProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .assignToProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono assignToProductAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + return assignToProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner assignToProduct( + String resourceGroupName, String serviceName, String productId, String tagId) { + return assignToProductAsync(resourceGroupName, serviceName, productId, tagId).block(); + } + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response assignToProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + return assignToProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId, context).block(); + } + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> detachFromProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachFromProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> detachFromProductWithResponseAsync( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (productId == null) { + return Mono.error(new IllegalArgumentException("Parameter productId is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachFromProduct( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + productId, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 detachFromProductAsync( + String resourceGroupName, String serviceName, String productId, String tagId) { + return detachFromProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 detachFromProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + detachFromProductAsync(resourceGroupName, serviceName, productId, tagId).block(); + } + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detachFromProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + return detachFromProductWithResponseAsync(resourceGroupName, serviceName, productId, tagId, context).block(); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String scope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + scope, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String scope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + scope, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, String scope) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, scope), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String scope = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, scope), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String scope, + Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, scope, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String scope = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, scope)); + } + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String scope, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, scope, context)); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateWithResponseAsync( + String resourceGroupName, String serviceName, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityState( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateWithResponseAsync( + String resourceGroupName, String serviceName, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityState( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityStateAsync(String resourceGroupName, String serviceName, String tagId) { + return getEntityStateWithResponseAsync(resourceGroupName, serviceName, tagId) + .flatMap((TagsGetEntityStateResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityState(String resourceGroupName, String serviceName, String tagId) { + getEntityStateAsync(resourceGroupName, serviceName, tagId).block(); + } + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityStateWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context) { + return getEntityStateWithResponseAsync(resourceGroupName, serviceName, tagId, context).block(); + } + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, String tagId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String tagId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String tagId) { + return getWithResponseAsync(resourceGroupName, serviceName, tagId) + .flatMap( + (TagsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner get(String resourceGroupName, String serviceName, String tagId) { + return getAsync(resourceGroupName, serviceName, tagId).block(); + } + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, tagId, context).block(); + } + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String tagId, + TagCreateUpdateParameters parameters, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String tagId, + TagCreateUpdateParameters parameters, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String tagId, + TagCreateUpdateParameters parameters, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, tagId, parameters, ifMatch) + .flatMap( + (TagsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String tagId, TagCreateUpdateParameters parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, tagId, parameters, ifMatch) + .flatMap( + (TagsCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner createOrUpdate( + String resourceGroupName, String serviceName, String tagId, TagCreateUpdateParameters parameters) { + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, tagId, parameters, ifMatch).block(); + } + + /** + * Creates a tag. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String tagId, + TagCreateUpdateParameters parameters, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, tagId, parameters, ifMatch, context) + .block(); + } + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, tagId, ifMatch, parameters) + .flatMap( + (TagsUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagContractInner update( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, tagId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String tagId, + String ifMatch, + TagCreateUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, tagId, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String tagId, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String tagId, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (tagId == null) { + return Mono.error(new IllegalArgumentException("Parameter tagId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + tagId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String tagId, String ifMatch) { + return deleteWithResponseAsync(resourceGroupName, serviceName, tagId, ifMatch) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String tagId, String ifMatch) { + deleteAsync(resourceGroupName, serviceName, tagId, ifMatch).block(); + } + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String tagId, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, tagId, ifMatch, 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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationNextSinglePageAsync(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.listByOperationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOperationNextSinglePageAsync(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 + .listByOperationNext(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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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.listByApiNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByApiNextSinglePageAsync(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 + .listByApiNext(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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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.listByProductNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByProductNextSinglePageAsync(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 + .listByProductNext(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 paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsImpl.java new file mode 100644 index 0000000000000..d8449f11a8da9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TagsImpl.java @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.TagsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; +import com.azure.resourcemanager.apimanagement.models.TagContract; +import com.azure.resourcemanager.apimanagement.models.Tags; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TagsImpl implements Tags { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsImpl.class); + + private final TagsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public TagsImpl( + TagsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId) { + PagedIterable inner = + this.serviceClient().listByOperation(resourceGroupName, serviceName, apiId, operationId); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByOperation(resourceGroupName, serviceName, apiId, operationId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public void getEntityStateByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + this.serviceClient().getEntityStateByOperation(resourceGroupName, serviceName, apiId, operationId, tagId); + } + + public Response getEntityStateByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + return this + .serviceClient() + .getEntityStateByOperationWithResponse(resourceGroupName, serviceName, apiId, operationId, tagId, context); + } + + public TagContract getByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + TagContractInner inner = + this.serviceClient().getByOperation(resourceGroupName, serviceName, apiId, operationId, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + Response inner = + this + .serviceClient() + .getByOperationWithResponse(resourceGroupName, serviceName, apiId, operationId, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TagContract assignToOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + TagContractInner inner = + this.serviceClient().assignToOperation(resourceGroupName, serviceName, apiId, operationId, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response assignToOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + Response inner = + this + .serviceClient() + .assignToOperationWithResponse(resourceGroupName, serviceName, apiId, operationId, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void detachFromOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId) { + this.serviceClient().detachFromOperation(resourceGroupName, serviceName, apiId, operationId, tagId); + } + + public Response detachFromOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context) { + return this + .serviceClient() + .detachFromOperationWithResponse(resourceGroupName, serviceName, apiId, operationId, tagId, context); + } + + public PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId) { + PagedIterable inner = this.serviceClient().listByApi(resourceGroupName, serviceName, apiId); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByApi(resourceGroupName, serviceName, apiId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public void getEntityStateByApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + this.serviceClient().getEntityStateByApi(resourceGroupName, serviceName, apiId, tagId); + } + + public Response getEntityStateByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + return this + .serviceClient() + .getEntityStateByApiWithResponse(resourceGroupName, serviceName, apiId, tagId, context); + } + + public TagContract getByApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + TagContractInner inner = this.serviceClient().getByApi(resourceGroupName, serviceName, apiId, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + Response inner = + this.serviceClient().getByApiWithResponse(resourceGroupName, serviceName, apiId, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TagContract assignToApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + TagContractInner inner = this.serviceClient().assignToApi(resourceGroupName, serviceName, apiId, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response assignToApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + Response inner = + this.serviceClient().assignToApiWithResponse(resourceGroupName, serviceName, apiId, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void detachFromApi(String resourceGroupName, String serviceName, String apiId, String tagId) { + this.serviceClient().detachFromApi(resourceGroupName, serviceName, apiId, tagId); + } + + public Response detachFromApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context) { + return this.serviceClient().detachFromApiWithResponse(resourceGroupName, serviceName, apiId, tagId, context); + } + + public PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, productId); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().listByProduct(resourceGroupName, serviceName, productId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public void getEntityStateByProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + this.serviceClient().getEntityStateByProduct(resourceGroupName, serviceName, productId, tagId); + } + + public Response getEntityStateByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + return this + .serviceClient() + .getEntityStateByProductWithResponse(resourceGroupName, serviceName, productId, tagId, context); + } + + public TagContract getByProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + TagContractInner inner = this.serviceClient().getByProduct(resourceGroupName, serviceName, productId, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + Response inner = + this.serviceClient().getByProductWithResponse(resourceGroupName, serviceName, productId, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TagContract assignToProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + TagContractInner inner = this.serviceClient().assignToProduct(resourceGroupName, serviceName, productId, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response assignToProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + Response inner = + this.serviceClient().assignToProductWithResponse(resourceGroupName, serviceName, productId, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void detachFromProduct(String resourceGroupName, String serviceName, String productId, String tagId) { + this.serviceClient().detachFromProduct(resourceGroupName, serviceName, productId, tagId); + } + + public Response detachFromProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context) { + return this + .serviceClient() + .detachFromProductWithResponse(resourceGroupName, serviceName, productId, tagId, context); + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String scope, + Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, top, skip, scope, context); + return Utils.mapPage(inner, inner1 -> new TagContractImpl(inner1, this.manager())); + } + + public void getEntityState(String resourceGroupName, String serviceName, String tagId) { + this.serviceClient().getEntityState(resourceGroupName, serviceName, tagId); + } + + public Response getEntityStateWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context) { + return this.serviceClient().getEntityStateWithResponse(resourceGroupName, serviceName, tagId, context); + } + + public TagContract get(String resourceGroupName, String serviceName, String tagId) { + TagContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, tagId); + if (inner != null) { + return new TagContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, tagId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String tagId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, tagId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, String serviceName, String tagId, String ifMatch, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, tagId, ifMatch, context); + } + + public TagContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String tagId = Utils.getValueFromIdByName(id, "tags"); + if (tagId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tags'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, tagId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String tagId = Utils.getValueFromIdByName(id, "tags"); + if (tagId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tags'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, tagId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String tagId = Utils.getValueFromIdByName(id, "tags"); + if (tagId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tags'.", id))); + } + String localIfMatch = null; + this.deleteWithResponse(resourceGroupName, serviceName, tagId, localIfMatch, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String tagId = Utils.getValueFromIdByName(id, "tags"); + if (tagId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tags'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, tagId, ifMatch, context); + } + + private TagsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public TagContractImpl define(String name) { + return new TagContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessClientImpl.java new file mode 100644 index 0000000000000..cb0509849f38c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessClientImpl.java @@ -0,0 +1,1732 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.TenantAccessClient; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AccessIdName; +import com.azure.resourcemanager.apimanagement.models.AccessInformationCollection; +import com.azure.resourcemanager.apimanagement.models.AccessInformationCreateParameters; +import com.azure.resourcemanager.apimanagement.models.AccessInformationUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.TenantAccessCreateResponse; +import com.azure.resourcemanager.apimanagement.models.TenantAccessGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.TenantAccessGetResponse; +import com.azure.resourcemanager.apimanagement.models.TenantAccessListSecretsResponse; +import com.azure.resourcemanager.apimanagement.models.TenantAccessUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TenantAccessClient. */ +public final class TenantAccessClientImpl implements TenantAccessClient { + private final ClientLogger logger = new ClientLogger(TenantAccessClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TenantAccessService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of TenantAccessClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TenantAccessClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(TenantAccessService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientTenantAccess to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientT") + private interface TenantAccessService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AccessInformationCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AccessInformationUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regeneratePrimaryKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateSecondaryKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono listSecrets( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter)); + } + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, context)); + } + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, AccessIdName accessName) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap((TenantAccessGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getEntityTag(String resourceGroupName, String serviceName, AccessIdName accessName) { + getEntityTagAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, accessName, context).block(); + } + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return getWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap( + (TenantAccessGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessInformationContractInner get(String resourceGroupName, String serviceName, AccessIdName accessName) { + return getAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, accessName, context).block(); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createWithResponseAsync( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + accessName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createWithResponseAsync( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + accessName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters parameters) { + return createWithResponseAsync(resourceGroupName, serviceName, accessName, ifMatch, parameters) + .flatMap( + (TenantAccessCreateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessInformationContractInner create( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters parameters) { + return createAsync(resourceGroupName, serviceName, accessName, ifMatch, parameters).block(); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationCreateParameters parameters, + Context context) { + return createWithResponseAsync(resourceGroupName, serviceName, accessName, ifMatch, parameters, context) + .block(); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + accessName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + accessName, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, accessName, ifMatch, parameters) + .flatMap( + (TenantAccessUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessInformationContractInner update( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, accessName, ifMatch, parameters).block(); + } + + /** + * Update tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access configuration. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Parameters supplied to retrieve the Tenant Access Information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + AccessIdName accessName, + String ifMatch, + AccessInformationUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, accessName, ifMatch, parameters, context) + .block(); + } + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePrimaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regeneratePrimaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePrimaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regeneratePrimaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regeneratePrimaryKeyAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return regeneratePrimaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + regeneratePrimaryKeyAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return regeneratePrimaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName, context).block(); + } + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateSecondaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateSecondaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateSecondaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateSecondaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateSecondaryKeyAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return regenerateSecondaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + regenerateSecondaryKeyAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return regenerateSecondaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName, context).block(); + } + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap( + (TenantAccessListSecretsResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessInformationSecretsContractInner listSecrets( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return listSecretsAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, serviceName, accessName, 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 paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsClientImpl.java new file mode 100644 index 0000000000000..3a77ae935b3f7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsClientImpl.java @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +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.apimanagement.fluent.TenantAccessGitsClient; +import com.azure.resourcemanager.apimanagement.models.AccessIdName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TenantAccessGitsClient. */ +public final class TenantAccessGitsClientImpl implements TenantAccessGitsClient { + private final ClientLogger logger = new ClientLogger(TenantAccessGitsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TenantAccessGitsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of TenantAccessGitsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TenantAccessGitsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(TenantAccessGitsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientTenantAccessGits to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientT") + private interface TenantAccessGitsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regeneratePrimaryKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateSecondaryKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("accessName") AccessIdName accessName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePrimaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regeneratePrimaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePrimaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regeneratePrimaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regeneratePrimaryKeyAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return regeneratePrimaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + regeneratePrimaryKeyAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return regeneratePrimaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName, context).block(); + } + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateSecondaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateSecondaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateSecondaryKeyWithResponseAsync( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accessName == null) { + return Mono.error(new IllegalArgumentException("Parameter accessName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateSecondaryKey( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accessName, + accept, + context); + } + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateSecondaryKeyAsync( + String resourceGroupName, String serviceName, AccessIdName accessName) { + return regenerateSecondaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + regenerateSecondaryKeyAsync(resourceGroupName, serviceName, accessName).block(); + } + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return regenerateSecondaryKeyWithResponseAsync(resourceGroupName, serviceName, accessName, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsImpl.java new file mode 100644 index 0000000000000..ced4b565db113 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessGitsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.TenantAccessGitsClient; +import com.azure.resourcemanager.apimanagement.models.AccessIdName; +import com.azure.resourcemanager.apimanagement.models.TenantAccessGits; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TenantAccessGitsImpl implements TenantAccessGits { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessGitsImpl.class); + + private final TenantAccessGitsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public TenantAccessGitsImpl( + TenantAccessGitsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + this.serviceClient().regeneratePrimaryKey(resourceGroupName, serviceName, accessName); + } + + public Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return this + .serviceClient() + .regeneratePrimaryKeyWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + this.serviceClient().regenerateSecondaryKey(resourceGroupName, serviceName, accessName); + } + + public Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return this + .serviceClient() + .regenerateSecondaryKeyWithResponse(resourceGroupName, serviceName, accessName, context); + } + + private TenantAccessGitsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessImpl.java new file mode 100644 index 0000000000000..0a761a0105143 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantAccessImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.TenantAccessClient; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner; +import com.azure.resourcemanager.apimanagement.models.AccessIdName; +import com.azure.resourcemanager.apimanagement.models.AccessInformationContract; +import com.azure.resourcemanager.apimanagement.models.AccessInformationSecretsContract; +import com.azure.resourcemanager.apimanagement.models.TenantAccess; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TenantAccessImpl implements TenantAccess { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessImpl.class); + + private final TenantAccessClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public TenantAccessImpl( + TenantAccessClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new AccessInformationContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessInformationContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, AccessIdName accessName) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, accessName); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public AccessInformationContract get(String resourceGroupName, String serviceName, AccessIdName accessName) { + AccessInformationContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, accessName); + if (inner != null) { + return new AccessInformationContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, accessName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessInformationContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + this.serviceClient().regeneratePrimaryKey(resourceGroupName, serviceName, accessName); + } + + public Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return this + .serviceClient() + .regeneratePrimaryKeyWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName) { + this.serviceClient().regenerateSecondaryKey(resourceGroupName, serviceName, accessName); + } + + public Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + return this + .serviceClient() + .regenerateSecondaryKeyWithResponse(resourceGroupName, serviceName, accessName, context); + } + + public AccessInformationSecretsContract listSecrets( + String resourceGroupName, String serviceName, AccessIdName accessName) { + AccessInformationSecretsContractInner inner = + this.serviceClient().listSecrets(resourceGroupName, serviceName, accessName); + if (inner != null) { + return new AccessInformationSecretsContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, serviceName, accessName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessInformationSecretsContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessInformationContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + AccessIdName accessName = AccessIdName.fromString(Utils.getValueFromIdByName(id, "tenant")); + if (accessName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tenant'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, accessName, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + AccessIdName accessName = AccessIdName.fromString(Utils.getValueFromIdByName(id, "tenant")); + if (accessName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tenant'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, accessName, context); + } + + private TenantAccessClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public AccessInformationContractImpl define(AccessIdName name) { + return new AccessInformationContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationSyncStateContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationSyncStateContractImpl.java new file mode 100644 index 0000000000000..533b750944ea6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationSyncStateContractImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.TenantConfigurationSyncStateContractInner; +import com.azure.resourcemanager.apimanagement.models.TenantConfigurationSyncStateContract; +import java.time.OffsetDateTime; + +public final class TenantConfigurationSyncStateContractImpl implements TenantConfigurationSyncStateContract { + private TenantConfigurationSyncStateContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + TenantConfigurationSyncStateContractImpl( + TenantConfigurationSyncStateContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String branch() { + return this.innerModel().branch(); + } + + public String commitId() { + return this.innerModel().commitId(); + } + + public Boolean isExport() { + return this.innerModel().isExport(); + } + + public Boolean isSynced() { + return this.innerModel().isSynced(); + } + + public Boolean isGitEnabled() { + return this.innerModel().isGitEnabled(); + } + + public OffsetDateTime syncDate() { + return this.innerModel().syncDate(); + } + + public OffsetDateTime configurationChangeDate() { + return this.innerModel().configurationChangeDate(); + } + + public TenantConfigurationSyncStateContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsClientImpl.java new file mode 100644 index 0000000000000..d6229511d8b2b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsClientImpl.java @@ -0,0 +1,1311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.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.apimanagement.fluent.TenantConfigurationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationResultContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantConfigurationSyncStateContractInner; +import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName; +import com.azure.resourcemanager.apimanagement.models.DeployConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.SaveConfigurationParameter; +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 TenantConfigurationsClient. */ +public final class TenantConfigurationsClientImpl implements TenantConfigurationsClient { + private final ClientLogger logger = new ClientLogger(TenantConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TenantConfigurationsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of TenantConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TenantConfigurationsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create(TenantConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientTenantConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientT") + private interface TenantConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{configurationName}/deploy") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deploy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationName") ConfigurationIdName configurationName, + @BodyParam("application/json") DeployConfigurationParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{configurationName}/save") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> save( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationName") ConfigurationIdName configurationName, + @BodyParam("application/json") SaveConfigurationParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{configurationName}/validate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationName") ConfigurationIdName configurationName, + @BodyParam("application/json") DeployConfigurationParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/tenant/{configurationName}/syncState") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSyncState( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationName") ConfigurationIdName configurationName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deployWithResponseAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deploy( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deployWithResponseAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deploy( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + parameters, + accept, + context); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResultContractInner> beginDeployAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + Mono>> mono = + deployWithResponseAsync(resourceGroupName, serviceName, configurationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultContractInner.class, + OperationResultContractInner.class, + Context.NONE); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResultContractInner> beginDeployAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deployWithResponseAsync(resourceGroupName, serviceName, configurationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultContractInner.class, + OperationResultContractInner.class, + context); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResultContractInner> beginDeploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + return beginDeployAsync(resourceGroupName, serviceName, configurationName, parameters).getSyncPoller(); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResultContractInner> beginDeploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + return beginDeployAsync(resourceGroupName, serviceName, configurationName, parameters, context).getSyncPoller(); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + return beginDeployAsync(resourceGroupName, serviceName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + return beginDeployAsync(resourceGroupName, serviceName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultContractInner deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + return deployAsync(resourceGroupName, serviceName, configurationName, parameters).block(); + } + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultContractInner deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + return deployAsync(resourceGroupName, serviceName, configurationName, parameters, context).block(); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> saveWithResponseAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .save( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> saveWithResponseAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .save( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + parameters, + accept, + context); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResultContractInner> beginSaveAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters) { + Mono>> mono = + saveWithResponseAsync(resourceGroupName, serviceName, configurationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultContractInner.class, + OperationResultContractInner.class, + Context.NONE); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResultContractInner> beginSaveAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + saveWithResponseAsync(resourceGroupName, serviceName, configurationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultContractInner.class, + OperationResultContractInner.class, + context); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResultContractInner> beginSave( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters) { + return beginSaveAsync(resourceGroupName, serviceName, configurationName, parameters).getSyncPoller(); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResultContractInner> beginSave( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context) { + return beginSaveAsync(resourceGroupName, serviceName, configurationName, parameters, context).getSyncPoller(); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono saveAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters) { + return beginSaveAsync(resourceGroupName, serviceName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono saveAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context) { + return beginSaveAsync(resourceGroupName, serviceName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultContractInner save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters) { + return saveAsync(resourceGroupName, serviceName, configurationName, parameters).block(); + } + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultContractInner save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context) { + return saveAsync(resourceGroupName, serviceName, configurationName, parameters, context).block(); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + parameters, + accept, + context); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResultContractInner> beginValidateAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + Mono>> mono = + validateWithResponseAsync(resourceGroupName, serviceName, configurationName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultContractInner.class, + OperationResultContractInner.class, + Context.NONE); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResultContractInner> beginValidateAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateWithResponseAsync(resourceGroupName, serviceName, configurationName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResultContractInner.class, + OperationResultContractInner.class, + context); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResultContractInner> beginValidate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + return beginValidateAsync(resourceGroupName, serviceName, configurationName, parameters).getSyncPoller(); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResultContractInner> beginValidate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + return beginValidateAsync(resourceGroupName, serviceName, configurationName, parameters, context) + .getSyncPoller(); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + return beginValidateAsync(resourceGroupName, serviceName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + return beginValidateAsync(resourceGroupName, serviceName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultContractInner validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + return validateAsync(resourceGroupName, serviceName, configurationName, parameters).block(); + } + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultContractInner validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + return validateAsync(resourceGroupName, serviceName, configurationName, parameters, context).block(); + } + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSyncStateWithResponseAsync( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSyncState( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSyncStateWithResponseAsync( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSyncState( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + configurationName, + accept, + context); + } + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSyncStateAsync( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName) { + return getSyncStateWithResponseAsync(resourceGroupName, serviceName, configurationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TenantConfigurationSyncStateContractInner getSyncState( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName) { + return getSyncStateAsync(resourceGroupName, serviceName, configurationName).block(); + } + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSyncStateWithResponse( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName, Context context) { + return getSyncStateWithResponseAsync(resourceGroupName, serviceName, configurationName, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsImpl.java new file mode 100644 index 0000000000000..e1c797384861c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantConfigurationsImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.TenantConfigurationsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationResultContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantConfigurationSyncStateContractInner; +import com.azure.resourcemanager.apimanagement.models.ConfigurationIdName; +import com.azure.resourcemanager.apimanagement.models.DeployConfigurationParameters; +import com.azure.resourcemanager.apimanagement.models.OperationResultContract; +import com.azure.resourcemanager.apimanagement.models.SaveConfigurationParameter; +import com.azure.resourcemanager.apimanagement.models.TenantConfigurationSyncStateContract; +import com.azure.resourcemanager.apimanagement.models.TenantConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TenantConfigurationsImpl implements TenantConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantConfigurationsImpl.class); + + private final TenantConfigurationsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public TenantConfigurationsImpl( + TenantConfigurationsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationResultContract deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + OperationResultContractInner inner = + this.serviceClient().deploy(resourceGroupName, serviceName, configurationName, parameters); + if (inner != null) { + return new OperationResultContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResultContract deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + OperationResultContractInner inner = + this.serviceClient().deploy(resourceGroupName, serviceName, configurationName, parameters, context); + if (inner != null) { + return new OperationResultContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResultContract save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters) { + OperationResultContractInner inner = + this.serviceClient().save(resourceGroupName, serviceName, configurationName, parameters); + if (inner != null) { + return new OperationResultContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResultContract save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context) { + OperationResultContractInner inner = + this.serviceClient().save(resourceGroupName, serviceName, configurationName, parameters, context); + if (inner != null) { + return new OperationResultContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResultContract validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters) { + OperationResultContractInner inner = + this.serviceClient().validate(resourceGroupName, serviceName, configurationName, parameters); + if (inner != null) { + return new OperationResultContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResultContract validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context) { + OperationResultContractInner inner = + this.serviceClient().validate(resourceGroupName, serviceName, configurationName, parameters, context); + if (inner != null) { + return new OperationResultContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public TenantConfigurationSyncStateContract getSyncState( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName) { + TenantConfigurationSyncStateContractInner inner = + this.serviceClient().getSyncState(resourceGroupName, serviceName, configurationName); + if (inner != null) { + return new TenantConfigurationSyncStateContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSyncStateWithResponse( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName, Context context) { + Response inner = + this.serviceClient().getSyncStateWithResponse(resourceGroupName, serviceName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TenantConfigurationSyncStateContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private TenantConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsClientImpl.java new file mode 100644 index 0000000000000..c368eb391a36e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsClientImpl.java @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.TenantSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; +import com.azure.resourcemanager.apimanagement.models.SettingsTypeName; +import com.azure.resourcemanager.apimanagement.models.TenantSettingsCollection; +import com.azure.resourcemanager.apimanagement.models.TenantSettingsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TenantSettingsClient. */ +public final class TenantSettingsClientImpl implements TenantSettingsClient { + private final ClientLogger logger = new ClientLogger(TenantSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TenantSettingsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of TenantSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TenantSettingsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(TenantSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientTenantSettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientT") + private interface TenantSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/settings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/settings/{settingsType}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingsType") SettingsTypeName settingsType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Context context) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter)); + } + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context) { + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, context)); + } + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, SettingsTypeName settingsType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingsType == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + settingsType, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, SettingsTypeName settingsType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (settingsType == null) { + return Mono.error(new IllegalArgumentException("Parameter settingsType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + settingsType, + accept, + context); + } + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, SettingsTypeName settingsType) { + return getWithResponseAsync(resourceGroupName, serviceName, settingsType) + .flatMap( + (TenantSettingsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TenantSettingsContractInner get( + String resourceGroupName, String serviceName, SettingsTypeName settingsType) { + return getAsync(resourceGroupName, serviceName, settingsType).block(); + } + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, SettingsTypeName settingsType, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, settingsType, 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 paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync( + 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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsContractImpl.java new file mode 100644 index 0000000000000..5233b7dc3fdec --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; +import com.azure.resourcemanager.apimanagement.models.TenantSettingsContract; +import java.util.Collections; +import java.util.Map; + +public final class TenantSettingsContractImpl implements TenantSettingsContract { + private TenantSettingsContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + TenantSettingsContractImpl( + TenantSettingsContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager 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 Map settings() { + Map inner = this.innerModel().settings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public TenantSettingsContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsImpl.java new file mode 100644 index 0000000000000..59bacc0936579 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/TenantSettingsImpl.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.apimanagement.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.apimanagement.fluent.TenantSettingsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; +import com.azure.resourcemanager.apimanagement.models.SettingsTypeName; +import com.azure.resourcemanager.apimanagement.models.TenantSettings; +import com.azure.resourcemanager.apimanagement.models.TenantSettingsContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TenantSettingsImpl implements TenantSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantSettingsImpl.class); + + private final TenantSettingsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public TenantSettingsImpl( + TenantSettingsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new TenantSettingsContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByService(resourceGroupName, serviceName, filter, context); + return Utils.mapPage(inner, inner1 -> new TenantSettingsContractImpl(inner1, this.manager())); + } + + public TenantSettingsContract get(String resourceGroupName, String serviceName, SettingsTypeName settingsType) { + TenantSettingsContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, settingsType); + if (inner != null) { + return new TenantSettingsContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, SettingsTypeName settingsType, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, settingsType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TenantSettingsContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private TenantSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsClientImpl.java new file mode 100644 index 0000000000000..10b35a5479663 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsClientImpl.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +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.apimanagement.fluent.UserConfirmationPasswordsClient; +import com.azure.resourcemanager.apimanagement.models.AppType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UserConfirmationPasswordsClient. */ +public final class UserConfirmationPasswordsClientImpl implements UserConfirmationPasswordsClient { + private final ClientLogger logger = new ClientLogger(UserConfirmationPasswordsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UserConfirmationPasswordsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of UserConfirmationPasswordsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UserConfirmationPasswordsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy + .create( + UserConfirmationPasswordsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientUserConfirmationPasswords to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientU") + private interface UserConfirmationPasswordsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/confirmations/password/send") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> send( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("appType") AppType appType, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> sendWithResponseAsync( + String resourceGroupName, String serviceName, String userId, AppType appType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .send( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> sendWithResponseAsync( + String resourceGroupName, String serviceName, String userId, AppType appType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .send( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + accept, + context); + } + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 sendAsync(String resourceGroupName, String serviceName, String userId, AppType appType) { + return sendWithResponseAsync(resourceGroupName, serviceName, userId, appType) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 sendAsync(String resourceGroupName, String serviceName, String userId) { + final AppType appType = null; + return sendWithResponseAsync(resourceGroupName, serviceName, userId, appType) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 send(String resourceGroupName, String serviceName, String userId) { + final AppType appType = null; + sendAsync(resourceGroupName, serviceName, userId, appType).block(); + } + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sendWithResponse( + String resourceGroupName, String serviceName, String userId, AppType appType, Context context) { + return sendWithResponseAsync(resourceGroupName, serviceName, userId, appType, context).block(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsImpl.java new file mode 100644 index 0000000000000..7d92a0553bee7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserConfirmationPasswordsImpl.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.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.UserConfirmationPasswordsClient; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.UserConfirmationPasswords; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UserConfirmationPasswordsImpl implements UserConfirmationPasswords { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserConfirmationPasswordsImpl.class); + + private final UserConfirmationPasswordsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public UserConfirmationPasswordsImpl( + UserConfirmationPasswordsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void send(String resourceGroupName, String serviceName, String userId) { + this.serviceClient().send(resourceGroupName, serviceName, userId); + } + + public Response sendWithResponse( + String resourceGroupName, String serviceName, String userId, AppType appType, Context context) { + return this.serviceClient().sendWithResponse(resourceGroupName, serviceName, userId, appType, context); + } + + private UserConfirmationPasswordsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserContractImpl.java new file mode 100644 index 0000000000000..e3b6a72441db9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserContractImpl.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.Confirmation; +import com.azure.resourcemanager.apimanagement.models.GenerateSsoUrlResult; +import com.azure.resourcemanager.apimanagement.models.GroupContractProperties; +import com.azure.resourcemanager.apimanagement.models.UserContract; +import com.azure.resourcemanager.apimanagement.models.UserCreateParameters; +import com.azure.resourcemanager.apimanagement.models.UserIdentityContract; +import com.azure.resourcemanager.apimanagement.models.UserState; +import com.azure.resourcemanager.apimanagement.models.UserTokenParameters; +import com.azure.resourcemanager.apimanagement.models.UserTokenResult; +import com.azure.resourcemanager.apimanagement.models.UserUpdateParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class UserContractImpl implements UserContract, UserContract.Definition, UserContract.Update { + private UserContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public UserState state() { + return this.innerModel().state(); + } + + public String note() { + return this.innerModel().note(); + } + + public List identities() { + List inner = this.innerModel().identities(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new UserIdentityContractImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String firstName() { + return this.innerModel().firstName(); + } + + public String lastName() { + return this.innerModel().lastName(); + } + + public String email() { + return this.innerModel().email(); + } + + public OffsetDateTime registrationDate() { + return this.innerModel().registrationDate(); + } + + public List groups() { + List inner = this.innerModel().groups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UserContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String userId; + + private Boolean createNotify; + + private String createIfMatch; + + private UserCreateParameters createParameters; + + private String updateIfMatch; + + private UserUpdateParameters updateParameters; + + public UserContractImpl withExistingService(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public UserContract create() { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, userId, createParameters, createNotify, createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public UserContract create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .createOrUpdateWithResponse( + resourceGroupName, serviceName, userId, createParameters, createNotify, createIfMatch, context) + .getValue(); + return this; + } + + UserContractImpl(String name, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = new UserContractInner(); + this.serviceManager = serviceManager; + this.userId = name; + this.createNotify = null; + this.createIfMatch = null; + this.createParameters = new UserCreateParameters(); + } + + public UserContractImpl update() { + this.updateIfMatch = null; + this.updateParameters = new UserUpdateParameters(); + return this; + } + + public UserContract apply() { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .updateWithResponse( + resourceGroupName, serviceName, userId, updateIfMatch, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public UserContract apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .updateWithResponse(resourceGroupName, serviceName, userId, updateIfMatch, updateParameters, context) + .getValue(); + return this; + } + + UserContractImpl( + UserContractInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "service"); + this.userId = Utils.getValueFromIdByName(innerObject.id(), "users"); + } + + public UserContract refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .getWithResponse(resourceGroupName, serviceName, userId, Context.NONE) + .getValue(); + return this; + } + + public UserContract refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .getWithResponse(resourceGroupName, serviceName, userId, context) + .getValue(); + return this; + } + + public GenerateSsoUrlResult generateSsoUrl() { + return serviceManager.users().generateSsoUrl(resourceGroupName, serviceName, userId); + } + + public Response generateSsoUrlWithResponse(Context context) { + return serviceManager.users().generateSsoUrlWithResponse(resourceGroupName, serviceName, userId, context); + } + + public UserTokenResult getSharedAccessToken(UserTokenParameters parameters) { + return serviceManager.users().getSharedAccessToken(resourceGroupName, serviceName, userId, parameters); + } + + public Response getSharedAccessTokenWithResponse(UserTokenParameters parameters, Context context) { + return serviceManager + .users() + .getSharedAccessTokenWithResponse(resourceGroupName, serviceName, userId, parameters, context); + } + + public UserContractImpl withState(UserState state) { + if (isInCreateMode()) { + this.createParameters.withState(state); + return this; + } else { + this.updateParameters.withState(state); + return this; + } + } + + public UserContractImpl withNote(String note) { + if (isInCreateMode()) { + this.createParameters.withNote(note); + return this; + } else { + this.updateParameters.withNote(note); + return this; + } + } + + public UserContractImpl withIdentities(List identities) { + if (isInCreateMode()) { + this.createParameters.withIdentities(identities); + return this; + } else { + this.updateParameters.withIdentities(identities); + return this; + } + } + + public UserContractImpl withEmail(String email) { + if (isInCreateMode()) { + this.createParameters.withEmail(email); + return this; + } else { + this.updateParameters.withEmail(email); + return this; + } + } + + public UserContractImpl withFirstName(String firstName) { + if (isInCreateMode()) { + this.createParameters.withFirstName(firstName); + return this; + } else { + this.updateParameters.withFirstName(firstName); + return this; + } + } + + public UserContractImpl withLastName(String lastName) { + if (isInCreateMode()) { + this.createParameters.withLastName(lastName); + return this; + } else { + this.updateParameters.withLastName(lastName); + return this; + } + } + + public UserContractImpl withPassword(String password) { + if (isInCreateMode()) { + this.createParameters.withPassword(password); + return this; + } else { + this.updateParameters.withPassword(password); + return this; + } + } + + public UserContractImpl withAppType(AppType appType) { + this.createParameters.withAppType(appType); + return this; + } + + public UserContractImpl withConfirmation(Confirmation confirmation) { + this.createParameters.withConfirmation(confirmation); + return this; + } + + public UserContractImpl withNotify(Boolean notify) { + this.createNotify = notify; + return this; + } + + public UserContractImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsClientImpl.java new file mode 100644 index 0000000000000..69a33e9abb810 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsClientImpl.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.apimanagement.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.apimanagement.fluent.UserGroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UserGroupsClient. */ +public final class UserGroupsClientImpl implements UserGroupsClient { + private final ClientLogger logger = new ClientLogger(UserGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UserGroupsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of UserGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UserGroupsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(UserGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientUserGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientU") + private interface UserGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/groups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String userId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String userId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String userId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, filter, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String userId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, userId, filter, top, skip)); + } + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, userId, filter, top, skip, 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 paged Group list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsImpl.java new file mode 100644 index 0000000000000..f6f0f04ca9eb9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserGroupsImpl.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.apimanagement.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.apimanagement.fluent.UserGroupsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.azure.resourcemanager.apimanagement.models.GroupContract; +import com.azure.resourcemanager.apimanagement.models.UserGroups; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UserGroupsImpl implements UserGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserGroupsImpl.class); + + private final UserGroupsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public UserGroupsImpl( + UserGroupsClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName, String userId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, userId); + return Utils.mapPage(inner, inner1 -> new GroupContractImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, userId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new GroupContractImpl(inner1, this.manager())); + } + + private UserGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesClientImpl.java new file mode 100644 index 0000000000000..f081b601672b2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesClientImpl.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.UserIdentitiesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.azure.resourcemanager.apimanagement.models.UserIdentityCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UserIdentitiesClient. */ +public final class UserIdentitiesClientImpl implements UserIdentitiesClient { + private final ClientLogger logger = new ClientLogger(UserIdentitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UserIdentitiesService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of UserIdentitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UserIdentitiesClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(UserIdentitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientUserIdentities to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientU") + private interface UserIdentitiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/identities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String userId) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String userId, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String userId) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, userId)); + } + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String userId, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, userId, 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 Users Identity list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Users Identity list representation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesImpl.java new file mode 100644 index 0000000000000..59eaff3b3da30 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentitiesImpl.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.apimanagement.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.apimanagement.fluent.UserIdentitiesClient; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.azure.resourcemanager.apimanagement.models.UserIdentities; +import com.azure.resourcemanager.apimanagement.models.UserIdentityContract; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UserIdentitiesImpl implements UserIdentities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentitiesImpl.class); + + private final UserIdentitiesClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public UserIdentitiesImpl( + UserIdentitiesClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName, String userId) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, userId); + return Utils.mapPage(inner, inner1 -> new UserIdentityContractImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String userId, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, userId, context); + return Utils.mapPage(inner, inner1 -> new UserIdentityContractImpl(inner1, this.manager())); + } + + private UserIdentitiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentityContractImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentityContractImpl.java new file mode 100644 index 0000000000000..7998a4f3f3fc8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserIdentityContractImpl.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.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.azure.resourcemanager.apimanagement.models.UserIdentityContract; + +public final class UserIdentityContractImpl implements UserIdentityContract { + private UserIdentityContractInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + UserIdentityContractImpl( + UserIdentityContractInner innerObject, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String provider() { + return this.innerModel().provider(); + } + + public String id() { + return this.innerModel().id(); + } + + public UserIdentityContractInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..92d8f6e6c275e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsClientImpl.java @@ -0,0 +1,660 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.UserSubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.SubscriptionCollection; +import com.azure.resourcemanager.apimanagement.models.UserSubscriptionsGetResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UserSubscriptionsClient. */ +public final class UserSubscriptionsClientImpl implements UserSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(UserSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UserSubscriptionsService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of UserSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UserSubscriptionsClientImpl(ApiManagementClientImpl client) { + this.service = + RestProxy.create(UserSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientUserSubscriptions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientU") + private interface UserSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/subscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/subscriptions/{sid}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @PathParam("sid") String sid, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String userId, String filter, Integer top, Integer skip) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + filter, + top, + skip, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String userId, String filter, Integer top, Integer skip) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String userId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, filter, top, skip), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, userId, filter, top, skip, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String userId) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, userId, filter, top, skip)); + } + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, userId, filter, top, skip, context)); + } + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String userId, String sid) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String userId, String sid, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (sid == null) { + return Mono.error(new IllegalArgumentException("Parameter sid is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + sid, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String userId, String sid) { + return getWithResponseAsync(resourceGroupName, serviceName, userId, sid) + .flatMap( + (UserSubscriptionsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionContractInner get(String resourceGroupName, String serviceName, String userId, String sid) { + return getAsync(resourceGroupName, serviceName, userId, sid).block(); + } + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String userId, String sid, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, userId, sid, 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 paged Subscriptions list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + @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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsImpl.java new file mode 100644 index 0000000000000..44a6be4731081 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserSubscriptionsImpl.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.apimanagement.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.apimanagement.fluent.UserSubscriptionsClient; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.azure.resourcemanager.apimanagement.models.SubscriptionContract; +import com.azure.resourcemanager.apimanagement.models.UserSubscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UserSubscriptionsImpl implements UserSubscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserSubscriptionsImpl.class); + + private final UserSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public UserSubscriptionsImpl( + UserSubscriptionsClient innerClient, + com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName, String userId) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, userId); + return Utils.mapPage(inner, inner1 -> new SubscriptionContractImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, userId, filter, top, skip, context); + return Utils.mapPage(inner, inner1 -> new SubscriptionContractImpl(inner1, this.manager())); + } + + public SubscriptionContract get(String resourceGroupName, String serviceName, String userId, String sid) { + SubscriptionContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, userId, sid); + if (inner != null) { + return new SubscriptionContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String userId, String sid, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, userId, sid, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SubscriptionContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private UserSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserTokenResultImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserTokenResultImpl.java new file mode 100644 index 0000000000000..5e2c7978473f5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UserTokenResultImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.implementation; + +import com.azure.resourcemanager.apimanagement.fluent.models.UserTokenResultInner; +import com.azure.resourcemanager.apimanagement.models.UserTokenResult; + +public final class UserTokenResultImpl implements UserTokenResult { + private UserTokenResultInner innerObject; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + UserTokenResultImpl( + UserTokenResultInner innerObject, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String value() { + return this.innerModel().value(); + } + + public UserTokenResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersClientImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersClientImpl.java new file mode 100644 index 0000000000000..d85b63e20ba60 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersClientImpl.java @@ -0,0 +1,1959 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.UsersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GenerateSsoUrlResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserTokenResultInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.UserCollection; +import com.azure.resourcemanager.apimanagement.models.UserCreateParameters; +import com.azure.resourcemanager.apimanagement.models.UserTokenParameters; +import com.azure.resourcemanager.apimanagement.models.UserUpdateParameters; +import com.azure.resourcemanager.apimanagement.models.UsersCreateOrUpdateResponse; +import com.azure.resourcemanager.apimanagement.models.UsersGetEntityTagResponse; +import com.azure.resourcemanager.apimanagement.models.UsersGetResponse; +import com.azure.resourcemanager.apimanagement.models.UsersUpdateResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsersClient. */ +public final class UsersClientImpl implements UsersClient { + private final ClientLogger logger = new ClientLogger(UsersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsersService service; + + /** The service client containing this operation class. */ + private final ApiManagementClientImpl client; + + /** + * Initializes an instance of UsersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsersClientImpl(ApiManagementClientImpl client) { + this.service = RestProxy.create(UsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ApiManagementClientUsers to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ApiManagementClientU") + private interface UsersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("expandGroups") Boolean expandGroups, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getEntityTag( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("notify") Boolean notify, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") UserCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") UserUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("deleteSubscriptions") Boolean deleteSubscriptions, + @QueryParam("notify") Boolean notify, + @HeaderParam("If-Match") String ifMatch, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("appType") AppType appType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/generateSsoUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateSsoUrl( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement" + + "/service/{serviceName}/users/{userId}/token") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSharedAccessToken( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("userId") String userId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") UserTokenParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Boolean expandGroups) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + expandGroups, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceSinglePageAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByService( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + filter, + top, + skip, + expandGroups, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Boolean expandGroups) { + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean expandGroups = null; + return new PagedFlux<>( + () -> listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups), + nextLink -> listByServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByServiceAsync( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + Context context) { + return new PagedFlux<>( + () -> + listByServiceSinglePageAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, context), + nextLink -> listByServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService(String resourceGroupName, String serviceName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final Boolean expandGroups = null; + return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups)); + } + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + Context context) { + return new PagedIterable<>( + listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, context)); + } + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagWithResponseAsync( + String resourceGroupName, String serviceName, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getEntityTag( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getEntityTagAsync(String resourceGroupName, String serviceName, String userId) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, userId) + .flatMap((UsersGetEntityTagResponse res) -> Mono.empty()); + } + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 getEntityTag(String resourceGroupName, String serviceName, String userId) { + getEntityTagAsync(resourceGroupName, serviceName, userId).block(); + } + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String userId, Context context) { + return getEntityTagWithResponseAsync(resourceGroupName, serviceName, userId, context).block(); + } + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String serviceName, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String userId) { + return getWithResponseAsync(resourceGroupName, serviceName, userId) + .flatMap( + (UsersGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserContractInner get(String resourceGroupName, String serviceName, String userId) { + return getAsync(resourceGroupName, serviceName, userId).block(); + } + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String userId, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, userId, context).block(); + } + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param notify Send an Email notification to the User. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String userId, + UserCreateParameters parameters, + Boolean notify, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param notify Send an Email notification to the User. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String userId, + UserCreateParameters parameters, + Boolean notify, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param notify Send an Email notification to the User. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String userId, + UserCreateParameters parameters, + Boolean notify, + String ifMatch) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, userId, parameters, notify, ifMatch) + .flatMap( + (UsersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String userId, UserCreateParameters parameters) { + final Boolean notify = null; + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, userId, parameters, notify, ifMatch) + .flatMap( + (UsersCreateOrUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserContractInner createOrUpdate( + String resourceGroupName, String serviceName, String userId, UserCreateParameters parameters) { + final Boolean notify = null; + final String ifMatch = null; + return createOrUpdateAsync(resourceGroupName, serviceName, userId, parameters, notify, ifMatch).block(); + } + + /** + * Creates or Updates a user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param notify Send an Email notification to the User. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String userId, + UserCreateParameters parameters, + Boolean notify, + String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, userId, parameters, notify, ifMatch, context) + .block(); + } + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, String serviceName, String userId, String ifMatch, UserUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + UserUpdateParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, String userId, String ifMatch, UserUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, serviceName, userId, ifMatch, parameters) + .flatMap( + (UsersUpdateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserContractInner update( + String resourceGroupName, String serviceName, String userId, String ifMatch, UserUpdateParameters parameters) { + return updateAsync(resourceGroupName, serviceName, userId, ifMatch, parameters).block(); + } + + /** + * Updates the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + UserUpdateParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, userId, ifMatch, parameters, context).block(); + } + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + deleteSubscriptions, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + deleteSubscriptions, + notify, + ifMatch, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + appType, + accept, + context); + } + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType) { + return deleteWithResponseAsync( + resourceGroupName, serviceName, userId, ifMatch, deleteSubscriptions, notify, appType) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String userId, String ifMatch) { + final Boolean deleteSubscriptions = null; + final Boolean notify = null; + final AppType appType = null; + return deleteWithResponseAsync( + resourceGroupName, serviceName, userId, ifMatch, deleteSubscriptions, notify, appType) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String userId, String ifMatch) { + final Boolean deleteSubscriptions = null; + final Boolean notify = null; + final AppType appType = null; + deleteAsync(resourceGroupName, serviceName, userId, ifMatch, deleteSubscriptions, notify, appType).block(); + } + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType, + Context context) { + return deleteWithResponseAsync( + resourceGroupName, serviceName, userId, ifMatch, deleteSubscriptions, notify, appType, context) + .block(); + } + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSsoUrlWithResponseAsync( + String resourceGroupName, String serviceName, String userId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateSsoUrl( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSsoUrlWithResponseAsync( + String resourceGroupName, String serviceName, String userId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateSsoUrl( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSsoUrlAsync( + String resourceGroupName, String serviceName, String userId) { + return generateSsoUrlWithResponseAsync(resourceGroupName, serviceName, userId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateSsoUrlResultInner generateSsoUrl(String resourceGroupName, String serviceName, String userId) { + return generateSsoUrlAsync(resourceGroupName, serviceName, userId).block(); + } + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateSsoUrlWithResponse( + String resourceGroupName, String serviceName, String userId, Context context) { + return generateSsoUrlWithResponseAsync(resourceGroupName, serviceName, userId, context).block(); + } + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSharedAccessTokenWithResponseAsync( + String resourceGroupName, String serviceName, String userId, UserTokenParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSharedAccessToken( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSharedAccessTokenWithResponseAsync( + String resourceGroupName, String serviceName, String userId, UserTokenParameters 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (userId == null) { + return Mono.error(new IllegalArgumentException("Parameter userId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSharedAccessToken( + this.client.getEndpoint(), + resourceGroupName, + serviceName, + userId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSharedAccessTokenAsync( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters) { + return getSharedAccessTokenWithResponseAsync(resourceGroupName, serviceName, userId, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserTokenResultInner getSharedAccessToken( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters) { + return getSharedAccessTokenAsync(resourceGroupName, serviceName, userId, parameters).block(); + } + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSharedAccessTokenWithResponse( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters, Context context) { + return getSharedAccessTokenWithResponseAsync(resourceGroupName, serviceName, userId, parameters, 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 paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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.listByServiceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByServiceNextSinglePageAsync(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 + .listByServiceNext(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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersImpl.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersImpl.java new file mode 100644 index 0000000000000..c63a38265a75c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/UsersImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.apimanagement.fluent.UsersClient; +import com.azure.resourcemanager.apimanagement.fluent.models.GenerateSsoUrlResultInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserTokenResultInner; +import com.azure.resourcemanager.apimanagement.models.AppType; +import com.azure.resourcemanager.apimanagement.models.GenerateSsoUrlResult; +import com.azure.resourcemanager.apimanagement.models.UserContract; +import com.azure.resourcemanager.apimanagement.models.UserTokenParameters; +import com.azure.resourcemanager.apimanagement.models.UserTokenResult; +import com.azure.resourcemanager.apimanagement.models.Users; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsersImpl implements Users { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersImpl.class); + + private final UsersClient innerClient; + + private final com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager; + + public UsersImpl( + UsersClient innerClient, com.azure.resourcemanager.apimanagement.ApiManagementManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByService(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listByService(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new UserContractImpl(inner1, this.manager())); + } + + public PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByService(resourceGroupName, serviceName, filter, top, skip, expandGroups, context); + return Utils.mapPage(inner, inner1 -> new UserContractImpl(inner1, this.manager())); + } + + public void getEntityTag(String resourceGroupName, String serviceName, String userId) { + this.serviceClient().getEntityTag(resourceGroupName, serviceName, userId); + } + + public Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String userId, Context context) { + return this.serviceClient().getEntityTagWithResponse(resourceGroupName, serviceName, userId, context); + } + + public UserContract get(String resourceGroupName, String serviceName, String userId) { + UserContractInner inner = this.serviceClient().get(resourceGroupName, serviceName, userId); + if (inner != null) { + return new UserContractImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String userId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, userId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UserContractImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String userId, String ifMatch) { + this.serviceClient().delete(resourceGroupName, serviceName, userId, ifMatch); + } + + public Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType, + Context context) { + return this + .serviceClient() + .deleteWithResponse( + resourceGroupName, serviceName, userId, ifMatch, deleteSubscriptions, notify, appType, context); + } + + public GenerateSsoUrlResult generateSsoUrl(String resourceGroupName, String serviceName, String userId) { + GenerateSsoUrlResultInner inner = this.serviceClient().generateSsoUrl(resourceGroupName, serviceName, userId); + if (inner != null) { + return new GenerateSsoUrlResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateSsoUrlWithResponse( + String resourceGroupName, String serviceName, String userId, Context context) { + Response inner = + this.serviceClient().generateSsoUrlWithResponse(resourceGroupName, serviceName, userId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GenerateSsoUrlResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UserTokenResult getSharedAccessToken( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters) { + UserTokenResultInner inner = + this.serviceClient().getSharedAccessToken(resourceGroupName, serviceName, userId, parameters); + if (inner != null) { + return new UserTokenResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSharedAccessTokenWithResponse( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters, Context context) { + Response inner = + this + .serviceClient() + .getSharedAccessTokenWithResponse(resourceGroupName, serviceName, userId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UserTokenResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UserContract 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String userId = Utils.getValueFromIdByName(id, "users"); + if (userId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, userId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String userId = Utils.getValueFromIdByName(id, "users"); + if (userId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, userId, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String userId = Utils.getValueFromIdByName(id, "users"); + if (userId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); + } + String localIfMatch = null; + Boolean localDeleteSubscriptions = null; + Boolean localNotify = null; + AppType localAppType = null; + this + .deleteWithResponse( + resourceGroupName, + serviceName, + userId, + localIfMatch, + localDeleteSubscriptions, + localNotify, + localAppType, + Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse( + String id, String ifMatch, Boolean deleteSubscriptions, Boolean notify, AppType appType, 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 serviceName = Utils.getValueFromIdByName(id, "service"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id))); + } + String userId = Utils.getValueFromIdByName(id, "users"); + if (userId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id))); + } + return this + .deleteWithResponse( + resourceGroupName, serviceName, userId, ifMatch, deleteSubscriptions, notify, appType, context); + } + + private UsersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apimanagement.ApiManagementManager manager() { + return this.serviceManager; + } + + public UserContractImpl define(String name) { + return new UserContractImpl(name, this.manager()); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/Utils.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/Utils.java new file mode 100644 index 0000000000000..7fbf38956cdc9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/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.apimanagement.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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/package-info.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/package-info.java new file mode 100644 index 0000000000000..e8aa47752dec3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/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 ApiManagementClient. ApiManagement Client. */ +package com.azure.resourcemanager.apimanagement.implementation; diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessIdName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessIdName.java new file mode 100644 index 0000000000000..5156f50d5b8ae --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessIdName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessIdName. */ +public final class AccessIdName extends ExpandableStringEnum { + /** Static value access for AccessIdName. */ + public static final AccessIdName ACCESS = fromString("access"); + + /** Static value gitAccess for AccessIdName. */ + public static final AccessIdName GIT_ACCESS = fromString("gitAccess"); + + /** + * Creates or finds a AccessIdName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessIdName. + */ + @JsonCreator + public static AccessIdName fromString(String name) { + return fromString(name, AccessIdName.class); + } + + /** @return known AccessIdName values. */ + public static Collection values() { + return values(AccessIdName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCollection.java new file mode 100644 index 0000000000000..cd902ef4eaea2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged AccessInformation list representation. */ +@Fluent +public final class AccessInformationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessInformationCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the AccessInformationCollection object itself. + */ + public AccessInformationCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationContract.java new file mode 100644 index 0000000000000..020460ad20402 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationContract.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; + +/** An immutable client-side representation of AccessInformationContract. */ +public interface AccessInformationContract { + /** + * 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 idPropertiesId property: Access Information type ('access' or 'gitAccess'). + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the principalId property: Principal (User) Identifier. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the enabled property: Determines whether direct access is enabled. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner object. + * + * @return the inner object. + */ + AccessInformationContractInner innerModel(); + + /** The entirety of the AccessInformationContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AccessInformationContract definition stages. */ + interface DefinitionStages { + /** The first stage of the AccessInformationContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AccessInformationContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the AccessInformationContract 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.WithPrincipalId, + DefinitionStages.WithPrimaryKey, + DefinitionStages.WithSecondaryKey, + DefinitionStages.WithEnabled, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccessInformationContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccessInformationContract create(Context context); + } + /** The stage of the AccessInformationContract definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: Principal (User) Identifier.. + * + * @param principalId Principal (User) Identifier. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + /** The stage of the AccessInformationContract definition allowing to specify primaryKey. */ + interface WithPrimaryKey { + /** + * Specifies the primaryKey property: Primary access key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value.. + * + * @param primaryKey Primary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * @return the next definition stage. + */ + WithCreate withPrimaryKey(String primaryKey); + } + /** The stage of the AccessInformationContract definition allowing to specify secondaryKey. */ + interface WithSecondaryKey { + /** + * Specifies the secondaryKey property: Secondary access key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value.. + * + * @param secondaryKey Secondary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * @return the next definition stage. + */ + WithCreate withSecondaryKey(String secondaryKey); + } + /** The stage of the AccessInformationContract definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Determines whether direct access is enabled.. + * + * @param enabled Determines whether direct access is enabled. + * @return the next definition stage. + */ + WithCreate withEnabled(Boolean enabled); + } + /** The stage of the AccessInformationContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the AccessInformationContract resource. + * + * @return the stage of resource update. + */ + AccessInformationContract.Update update(); + + /** The template for AccessInformationContract update. */ + interface Update extends UpdateStages.WithEnabled, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AccessInformationContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AccessInformationContract apply(Context context); + } + /** The AccessInformationContract update stages. */ + interface UpdateStages { + /** The stage of the AccessInformationContract update allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: Determines whether direct access is enabled.. + * + * @param enabled Determines whether direct access is enabled. + * @return the next definition stage. + */ + Update withEnabled(Boolean enabled); + } + /** The stage of the AccessInformationContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AccessInformationContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AccessInformationContract refresh(Context context); + + /** + * Regenerate primary access key. + * + * @throws com.azure.core.management.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 regeneratePrimaryKey(); + + /** + * Regenerate primary access key. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response regeneratePrimaryKeyWithResponse(Context context); + + /** + * Regenerate secondary access key. + * + * @throws com.azure.core.management.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 regenerateSecondaryKey(); + + /** + * Regenerate secondary access key. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response regenerateSecondaryKeyWithResponse(Context context); + + /** + * Get tenant access information details. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant access information details. + */ + AccessInformationSecretsContract listSecrets(); + + /** + * Get tenant access information details. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant access information details. + */ + Response listSecretsWithResponse(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCreateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCreateParameters.java new file mode 100644 index 0000000000000..5b47c92f8cc93 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationCreateParameters.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.apimanagement.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; + +/** Tenant access information update parameters. */ +@JsonFlatten +@Fluent +public class AccessInformationCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessInformationCreateParameters.class); + + /* + * Principal (User) Identifier. + */ + @JsonProperty(value = "properties.principalId") + private String principalId; + + /* + * Primary access key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "properties.primaryKey") + private String primaryKey; + + /* + * Secondary access key. This property will not be filled on 'GET' + * operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "properties.secondaryKey") + private String secondaryKey; + + /* + * Determines whether direct access is enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Get the principalId property: Principal (User) Identifier. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Principal (User) Identifier. + * + * @param principalId the principalId value to set. + * @return the AccessInformationCreateParameters object itself. + */ + public AccessInformationCreateParameters withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the primaryKey property: Primary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @param primaryKey the primaryKey value to set. + * @return the AccessInformationCreateParameters object itself. + */ + public AccessInformationCreateParameters withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @param secondaryKey the secondaryKey value to set. + * @return the AccessInformationCreateParameters object itself. + */ + public AccessInformationCreateParameters withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the enabled property: Determines whether direct access is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether direct access is enabled. + * + * @param enabled the enabled value to set. + * @return the AccessInformationCreateParameters object itself. + */ + public AccessInformationCreateParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationSecretsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationSecretsContract.java new file mode 100644 index 0000000000000..eb222fdf9f171 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationSecretsContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner; + +/** An immutable client-side representation of AccessInformationSecretsContract. */ +public interface AccessInformationSecretsContract { + /** + * Gets the id property: Access Information type ('access' or 'gitAccess'). + * + * @return the id value. + */ + String id(); + + /** + * Gets the principalId property: Principal (User) Identifier. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the primaryKey property: Primary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: Secondary access key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the enabled property: Determines whether direct access is enabled. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner + * object. + * + * @return the inner object. + */ + AccessInformationSecretsContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationUpdateParameters.java new file mode 100644 index 0000000000000..dd2347c850851 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AccessInformationUpdateParameters.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.apimanagement.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; + +/** Tenant access information update parameters. */ +@JsonFlatten +@Fluent +public class AccessInformationUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessInformationUpdateParameters.class); + + /* + * Determines whether direct access is enabled. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /** + * Get the enabled property: Determines whether direct access is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether direct access is enabled. + * + * @param enabled the enabled value to set. + * @return the AccessInformationUpdateParameters object itself. + */ + public AccessInformationUpdateParameters withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AdditionalLocation.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AdditionalLocation.java new file mode 100644 index 0000000000000..f050bd87bce2d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AdditionalLocation.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.apimanagement.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; + +/** Description of an additional API Management resource location. */ +@Fluent +public final class AdditionalLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdditionalLocation.class); + + /* + * The location name of the additional region among Azure Data center + * regions. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * SKU properties of the API Management service. + */ + @JsonProperty(value = "sku", required = true) + private ApiManagementServiceSkuProperties sku; + + /* + * A list of availability zones denoting where the resource needs to come + * from. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Public Static Load Balanced IP addresses of the API Management service + * in the additional location. Available only for Basic, Standard, Premium + * and Isolated SKU. + */ + @JsonProperty(value = "publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * Private Static Load Balanced IP addresses of the API Management service + * which is deployed in an Internal Virtual Network in a particular + * additional location. Available only for Basic, Standard, Premium and + * Isolated SKU. + */ + @JsonProperty(value = "privateIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List privateIpAddresses; + + /* + * Virtual network configuration for the location. + */ + @JsonProperty(value = "virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /* + * Gateway URL of the API Management service in the Region. + */ + @JsonProperty(value = "gatewayRegionalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayRegionalUrl; + + /* + * Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in this additional + * location. + */ + @JsonProperty(value = "disableGateway") + private Boolean disableGateway; + + /** + * Get the location property: The location name of the additional region among Azure Data center regions. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location name of the additional region among Azure Data center regions. + * + * @param location the location value to set. + * @return the AdditionalLocation object itself. + */ + public AdditionalLocation withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the sku property: SKU properties of the API Management service. + * + * @return the sku value. + */ + public ApiManagementServiceSkuProperties sku() { + return this.sku; + } + + /** + * Set the sku property: SKU properties of the API Management service. + * + * @param sku the sku value to set. + * @return the AdditionalLocation object itself. + */ + public AdditionalLocation withSku(ApiManagementServiceSkuProperties sku) { + this.sku = sku; + return this; + } + + /** + * Get the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @param zones the zones value to set. + * @return the AdditionalLocation object itself. + */ + public AdditionalLocation withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the publicIpAddresses property: Public Static Load Balanced IP addresses of the API Management service in the + * additional location. Available only for Basic, Standard, Premium and Isolated SKU. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the privateIpAddresses property: Private Static Load Balanced IP addresses of the API Management service + * which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, + * Standard, Premium and Isolated SKU. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Get the virtualNetworkConfiguration property: Virtual network configuration for the location. + * + * @return the virtualNetworkConfiguration value. + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set the virtualNetworkConfiguration property: Virtual network configuration for the location. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set. + * @return the AdditionalLocation object itself. + */ + public AdditionalLocation withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get the gatewayRegionalUrl property: Gateway URL of the API Management service in the Region. + * + * @return the gatewayRegionalUrl value. + */ + public String gatewayRegionalUrl() { + return this.gatewayRegionalUrl; + } + + /** + * Get the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in this additional location. + * + * @return the disableGateway value. + */ + public Boolean disableGateway() { + return this.disableGateway; + } + + /** + * Set the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in this additional location. + * + * @param disableGateway the disableGateway value to set. + * @return the AdditionalLocation object itself. + */ + public AdditionalLocation withDisableGateway(Boolean disableGateway) { + this.disableGateway = disableGateway; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model AdditionalLocation")); + } + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model AdditionalLocation")); + } else { + sku().validate(); + } + if (virtualNetworkConfiguration() != null) { + virtualNetworkConfiguration().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AlwaysLog.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AlwaysLog.java new file mode 100644 index 0000000000000..45294d2ea65ba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AlwaysLog.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlwaysLog. */ +public final class AlwaysLog extends ExpandableStringEnum { + /** Static value allErrors for AlwaysLog. */ + public static final AlwaysLog ALL_ERRORS = fromString("allErrors"); + + /** + * Creates or finds a AlwaysLog from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlwaysLog. + */ + @JsonCreator + public static AlwaysLog fromString(String name) { + return fromString(name, AlwaysLog.class); + } + + /** @return known AlwaysLog values. */ + public static Collection values() { + return values(AlwaysLog.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCollection.java new file mode 100644 index 0000000000000..1e168a7224377 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Api list representation. */ +@Fluent +public final class ApiCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the ApiCollection object itself. + */ + public ApiCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContract.java new file mode 100644 index 0000000000000..f40d11133c7b0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContract.java @@ -0,0 +1,702 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; +import java.util.List; + +/** An immutable client-side representation of ApiContract. */ +public interface ApiContract { + /** + * 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 description property: Description of the API. May include HTML formatting tags. + * + * @return the description value. + */ + String description(); + + /** + * Gets the authenticationSettings property: Collection of authentication settings included into this API. + * + * @return the authenticationSettings value. + */ + AuthenticationSettingsContract authenticationSettings(); + + /** + * Gets the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @return the subscriptionKeyParameterNames value. + */ + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames(); + + /** + * Gets the apiType property: Type of API. + * + * @return the apiType value. + */ + ApiType apiType(); + + /** + * Gets the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @return the apiRevision value. + */ + String apiRevision(); + + /** + * Gets the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Gets the isCurrent property: Indicates if API revision is current api revision. + * + * @return the isCurrent value. + */ + Boolean isCurrent(); + + /** + * Gets the isOnline property: Indicates if API revision is accessible via the gateway. + * + * @return the isOnline value. + */ + Boolean isOnline(); + + /** + * Gets the apiRevisionDescription property: Description of the Api Revision. + * + * @return the apiRevisionDescription value. + */ + String apiRevisionDescription(); + + /** + * Gets the apiVersionDescription property: Description of the Api Version. + * + * @return the apiVersionDescription value. + */ + String apiVersionDescription(); + + /** + * Gets the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @return the apiVersionSetId value. + */ + String apiVersionSetId(); + + /** + * Gets the subscriptionRequired property: Specifies whether an API or Product subscription is required for + * accessing the API. + * + * @return the subscriptionRequired value. + */ + Boolean subscriptionRequired(); + + /** + * Gets the sourceApiId property: API identifier of the source API. + * + * @return the sourceApiId value. + */ + String sourceApiId(); + + /** + * Gets the displayName property: API name. Must be 1 to 300 characters long. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @return the serviceUrl value. + */ + String serviceUrl(); + + /** + * Gets the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + String path(); + + /** + * Gets the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + List protocols(); + + /** + * Gets the apiVersionSet property: Version set details. + * + * @return the apiVersionSet value. + */ + ApiVersionSetContractDetails apiVersionSet(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner object. + * + * @return the inner object. + */ + ApiContractInner innerModel(); + + /** The entirety of the ApiContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ApiContract definition stages. */ + interface DefinitionStages { + /** The first stage of the ApiContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ApiContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the ApiContract 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.WithDescription, + DefinitionStages.WithAuthenticationSettings, + DefinitionStages.WithSubscriptionKeyParameterNames, + DefinitionStages.WithApiType, + DefinitionStages.WithApiRevision, + DefinitionStages.WithApiVersion, + DefinitionStages.WithIsCurrent, + DefinitionStages.WithApiRevisionDescription, + DefinitionStages.WithApiVersionDescription, + DefinitionStages.WithApiVersionSetId, + DefinitionStages.WithSubscriptionRequired, + DefinitionStages.WithSourceApiId, + DefinitionStages.WithDisplayName, + DefinitionStages.WithServiceUrl, + DefinitionStages.WithPath, + DefinitionStages.WithProtocols, + DefinitionStages.WithApiVersionSet, + DefinitionStages.WithValue, + DefinitionStages.WithFormat, + DefinitionStages.WithWsdlSelector, + DefinitionStages.WithSoapApiType, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiContract create(Context context); + } + /** The stage of the ApiContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the API. May include HTML formatting tags.. + * + * @param description Description of the API. May include HTML formatting tags. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ApiContract definition allowing to specify authenticationSettings. */ + interface WithAuthenticationSettings { + /** + * Specifies the authenticationSettings property: Collection of authentication settings included into this + * API.. + * + * @param authenticationSettings Collection of authentication settings included into this API. + * @return the next definition stage. + */ + WithCreate withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings); + } + /** The stage of the ApiContract definition allowing to specify subscriptionKeyParameterNames. */ + interface WithSubscriptionKeyParameterNames { + /** + * Specifies the subscriptionKeyParameterNames property: Protocols over which API is made available.. + * + * @param subscriptionKeyParameterNames Protocols over which API is made available. + * @return the next definition stage. + */ + WithCreate withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames); + } + /** The stage of the ApiContract definition allowing to specify apiType. */ + interface WithApiType { + /** + * Specifies the apiType property: Type of API.. + * + * @param apiType Type of API. + * @return the next definition stage. + */ + WithCreate withApiType(ApiType apiType); + } + /** The stage of the ApiContract definition allowing to specify apiRevision. */ + interface WithApiRevision { + /** + * Specifies the apiRevision property: Describes the Revision of the Api. If no value is provided, default + * revision 1 is created. + * + * @param apiRevision Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * @return the next definition stage. + */ + WithCreate withApiRevision(String apiRevision); + } + /** The stage of the ApiContract definition allowing to specify apiVersion. */ + interface WithApiVersion { + /** + * Specifies the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @param apiVersion Indicates the Version identifier of the API if the API is versioned. + * @return the next definition stage. + */ + WithCreate withApiVersion(String apiVersion); + } + /** The stage of the ApiContract definition allowing to specify isCurrent. */ + interface WithIsCurrent { + /** + * Specifies the isCurrent property: Indicates if API revision is current api revision.. + * + * @param isCurrent Indicates if API revision is current api revision. + * @return the next definition stage. + */ + WithCreate withIsCurrent(Boolean isCurrent); + } + /** The stage of the ApiContract definition allowing to specify apiRevisionDescription. */ + interface WithApiRevisionDescription { + /** + * Specifies the apiRevisionDescription property: Description of the Api Revision.. + * + * @param apiRevisionDescription Description of the Api Revision. + * @return the next definition stage. + */ + WithCreate withApiRevisionDescription(String apiRevisionDescription); + } + /** The stage of the ApiContract definition allowing to specify apiVersionDescription. */ + interface WithApiVersionDescription { + /** + * Specifies the apiVersionDescription property: Description of the Api Version.. + * + * @param apiVersionDescription Description of the Api Version. + * @return the next definition stage. + */ + WithCreate withApiVersionDescription(String apiVersionDescription); + } + /** The stage of the ApiContract definition allowing to specify apiVersionSetId. */ + interface WithApiVersionSetId { + /** + * Specifies the apiVersionSetId property: A resource identifier for the related ApiVersionSet.. + * + * @param apiVersionSetId A resource identifier for the related ApiVersionSet. + * @return the next definition stage. + */ + WithCreate withApiVersionSetId(String apiVersionSetId); + } + /** The stage of the ApiContract definition allowing to specify subscriptionRequired. */ + interface WithSubscriptionRequired { + /** + * Specifies the subscriptionRequired property: Specifies whether an API or Product subscription is required + * for accessing the API.. + * + * @param subscriptionRequired Specifies whether an API or Product subscription is required for accessing + * the API. + * @return the next definition stage. + */ + WithCreate withSubscriptionRequired(Boolean subscriptionRequired); + } + /** The stage of the ApiContract definition allowing to specify sourceApiId. */ + interface WithSourceApiId { + /** + * Specifies the sourceApiId property: API identifier of the source API.. + * + * @param sourceApiId API identifier of the source API. + * @return the next definition stage. + */ + WithCreate withSourceApiId(String sourceApiId); + } + /** The stage of the ApiContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: API name. Must be 1 to 300 characters long.. + * + * @param displayName API name. Must be 1 to 300 characters long. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the ApiContract definition allowing to specify serviceUrl. */ + interface WithServiceUrl { + /** + * Specifies the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be + * more than 2000 characters long.. + * + * @param serviceUrl Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * @return the next definition stage. + */ + WithCreate withServiceUrl(String serviceUrl); + } + /** The stage of the ApiContract definition allowing to specify path. */ + interface WithPath { + /** + * Specifies the path property: Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API endpoint base URL specified during + * the service instance creation to form a public URL for this API.. + * + * @param path Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service + * instance creation to form a public URL for this API. + * @return the next definition stage. + */ + WithCreate withPath(String path); + } + /** The stage of the ApiContract definition allowing to specify protocols. */ + interface WithProtocols { + /** + * Specifies the protocols property: Describes on which protocols the operations in this API can be + * invoked.. + * + * @param protocols Describes on which protocols the operations in this API can be invoked. + * @return the next definition stage. + */ + WithCreate withProtocols(List protocols); + } + /** The stage of the ApiContract definition allowing to specify apiVersionSet. */ + interface WithApiVersionSet { + /** + * Specifies the apiVersionSet property: Version set details. + * + * @param apiVersionSet Version set details. + * @return the next definition stage. + */ + WithCreate withApiVersionSet(ApiVersionSetContractDetails apiVersionSet); + } + /** The stage of the ApiContract definition allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Content value when Importing an API.. + * + * @param value Content value when Importing an API. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + /** The stage of the ApiContract definition allowing to specify format. */ + interface WithFormat { + /** + * Specifies the format property: Format of the Content in which the API is getting imported.. + * + * @param format Format of the Content in which the API is getting imported. + * @return the next definition stage. + */ + WithCreate withFormat(ContentFormat format); + } + /** The stage of the ApiContract definition allowing to specify wsdlSelector. */ + interface WithWsdlSelector { + /** + * Specifies the wsdlSelector property: Criteria to limit import of WSDL to a subset of the document.. + * + * @param wsdlSelector Criteria to limit import of WSDL to a subset of the document. + * @return the next definition stage. + */ + WithCreate withWsdlSelector(ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector); + } + /** The stage of the ApiContract definition allowing to specify soapApiType. */ + interface WithSoapApiType { + /** + * Specifies the soapApiType property: Type of Api to create. * `http` creates a SOAP to REST API * `soap` + * creates a SOAP pass-through API .. + * + * @param soapApiType Type of Api to create. * `http` creates a SOAP to REST API * `soap` creates a SOAP + * pass-through API . + * @return the next definition stage. + */ + WithCreate withSoapApiType(SoapApiType soapApiType); + } + /** The stage of the ApiContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the ApiContract resource. + * + * @return the stage of resource update. + */ + ApiContract.Update update(); + + /** The template for ApiContract update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithAuthenticationSettings, + UpdateStages.WithSubscriptionKeyParameterNames, + UpdateStages.WithApiType, + UpdateStages.WithApiRevision, + UpdateStages.WithApiVersion, + UpdateStages.WithIsCurrent, + UpdateStages.WithApiRevisionDescription, + UpdateStages.WithApiVersionDescription, + UpdateStages.WithApiVersionSetId, + UpdateStages.WithSubscriptionRequired, + UpdateStages.WithDisplayName, + UpdateStages.WithServiceUrl, + UpdateStages.WithPath, + UpdateStages.WithProtocols, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiContract apply(Context context); + } + /** The ApiContract update stages. */ + interface UpdateStages { + /** The stage of the ApiContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the API. May include HTML formatting tags.. + * + * @param description Description of the API. May include HTML formatting tags. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the ApiContract update allowing to specify authenticationSettings. */ + interface WithAuthenticationSettings { + /** + * Specifies the authenticationSettings property: Collection of authentication settings included into this + * API.. + * + * @param authenticationSettings Collection of authentication settings included into this API. + * @return the next definition stage. + */ + Update withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings); + } + /** The stage of the ApiContract update allowing to specify subscriptionKeyParameterNames. */ + interface WithSubscriptionKeyParameterNames { + /** + * Specifies the subscriptionKeyParameterNames property: Protocols over which API is made available.. + * + * @param subscriptionKeyParameterNames Protocols over which API is made available. + * @return the next definition stage. + */ + Update withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames); + } + /** The stage of the ApiContract update allowing to specify apiType. */ + interface WithApiType { + /** + * Specifies the apiType property: Type of API.. + * + * @param apiType Type of API. + * @return the next definition stage. + */ + Update withApiType(ApiType apiType); + } + /** The stage of the ApiContract update allowing to specify apiRevision. */ + interface WithApiRevision { + /** + * Specifies the apiRevision property: Describes the Revision of the Api. If no value is provided, default + * revision 1 is created. + * + * @param apiRevision Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * @return the next definition stage. + */ + Update withApiRevision(String apiRevision); + } + /** The stage of the ApiContract update allowing to specify apiVersion. */ + interface WithApiVersion { + /** + * Specifies the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @param apiVersion Indicates the Version identifier of the API if the API is versioned. + * @return the next definition stage. + */ + Update withApiVersion(String apiVersion); + } + /** The stage of the ApiContract update allowing to specify isCurrent. */ + interface WithIsCurrent { + /** + * Specifies the isCurrent property: Indicates if API revision is current api revision.. + * + * @param isCurrent Indicates if API revision is current api revision. + * @return the next definition stage. + */ + Update withIsCurrent(Boolean isCurrent); + } + /** The stage of the ApiContract update allowing to specify apiRevisionDescription. */ + interface WithApiRevisionDescription { + /** + * Specifies the apiRevisionDescription property: Description of the Api Revision.. + * + * @param apiRevisionDescription Description of the Api Revision. + * @return the next definition stage. + */ + Update withApiRevisionDescription(String apiRevisionDescription); + } + /** The stage of the ApiContract update allowing to specify apiVersionDescription. */ + interface WithApiVersionDescription { + /** + * Specifies the apiVersionDescription property: Description of the Api Version.. + * + * @param apiVersionDescription Description of the Api Version. + * @return the next definition stage. + */ + Update withApiVersionDescription(String apiVersionDescription); + } + /** The stage of the ApiContract update allowing to specify apiVersionSetId. */ + interface WithApiVersionSetId { + /** + * Specifies the apiVersionSetId property: A resource identifier for the related ApiVersionSet.. + * + * @param apiVersionSetId A resource identifier for the related ApiVersionSet. + * @return the next definition stage. + */ + Update withApiVersionSetId(String apiVersionSetId); + } + /** The stage of the ApiContract update allowing to specify subscriptionRequired. */ + interface WithSubscriptionRequired { + /** + * Specifies the subscriptionRequired property: Specifies whether an API or Product subscription is required + * for accessing the API.. + * + * @param subscriptionRequired Specifies whether an API or Product subscription is required for accessing + * the API. + * @return the next definition stage. + */ + Update withSubscriptionRequired(Boolean subscriptionRequired); + } + /** The stage of the ApiContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: API name.. + * + * @param displayName API name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the ApiContract update allowing to specify serviceUrl. */ + interface WithServiceUrl { + /** + * Specifies the serviceUrl property: Absolute URL of the backend service implementing this API.. + * + * @param serviceUrl Absolute URL of the backend service implementing this API. + * @return the next definition stage. + */ + Update withServiceUrl(String serviceUrl); + } + /** The stage of the ApiContract update allowing to specify path. */ + interface WithPath { + /** + * Specifies the path property: Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API endpoint base URL specified during + * the service instance creation to form a public URL for this API.. + * + * @param path Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service + * instance creation to form a public URL for this API. + * @return the next definition stage. + */ + Update withPath(String path); + } + /** The stage of the ApiContract update allowing to specify protocols. */ + interface WithProtocols { + /** + * Specifies the protocols property: Describes on which protocols the operations in this API can be + * invoked.. + * + * @param protocols Describes on which protocols the operations in this API can be invoked. + * @return the next definition stage. + */ + Update withProtocols(List protocols); + } + /** The stage of the ApiContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractProperties.java new file mode 100644 index 0000000000000..b9384cba7cce4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractProperties.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Api Entity Properties. */ +@Fluent +public class ApiContractProperties extends ApiEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiContractProperties.class); + + /* + * API identifier of the source API. + */ + @JsonProperty(value = "sourceApiId") + private String sourceApiId; + + /* + * API name. Must be 1 to 300 characters long. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Absolute URL of the backend service implementing this API. Cannot be + * more than 2000 characters long. + */ + @JsonProperty(value = "serviceUrl") + private String serviceUrl; + + /* + * Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API + * endpoint base URL specified during the service instance creation to form + * a public URL for this API. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /* + * Describes on which protocols the operations in this API can be invoked. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /* + * Version set details + */ + @JsonProperty(value = "apiVersionSet") + private ApiVersionSetContractDetails apiVersionSet; + + /** + * Get the sourceApiId property: API identifier of the source API. + * + * @return the sourceApiId value. + */ + public String sourceApiId() { + return this.sourceApiId; + } + + /** + * Set the sourceApiId property: API identifier of the source API. + * + * @param sourceApiId the sourceApiId value to set. + * @return the ApiContractProperties object itself. + */ + public ApiContractProperties withSourceApiId(String sourceApiId) { + this.sourceApiId = sourceApiId; + return this; + } + + /** + * Get the displayName property: API name. Must be 1 to 300 characters long. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: API name. Must be 1 to 300 characters long. + * + * @param displayName the displayName value to set. + * @return the ApiContractProperties object itself. + */ + public ApiContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Set the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @param serviceUrl the serviceUrl value to set. + * @return the ApiContractProperties object itself. + */ + public ApiContractProperties withServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + return this; + } + + /** + * Get the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @param path the path value to set. + * @return the ApiContractProperties object itself. + */ + public ApiContractProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @param protocols the protocols value to set. + * @return the ApiContractProperties object itself. + */ + public ApiContractProperties withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the apiVersionSet property: Version set details. + * + * @return the apiVersionSet value. + */ + public ApiVersionSetContractDetails apiVersionSet() { + return this.apiVersionSet; + } + + /** + * Set the apiVersionSet property: Version set details. + * + * @param apiVersionSet the apiVersionSet value to set. + * @return the ApiContractProperties object itself. + */ + public ApiContractProperties withApiVersionSet(ApiVersionSetContractDetails apiVersionSet) { + this.apiVersionSet = apiVersionSet; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings) { + super.withAuthenticationSettings(authenticationSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + super.withSubscriptionKeyParameterNames(subscriptionKeyParameterNames); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withApiType(ApiType apiType) { + super.withApiType(apiType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withApiRevision(String apiRevision) { + super.withApiRevision(apiRevision); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withApiVersion(String apiVersion) { + super.withApiVersion(apiVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withIsCurrent(Boolean isCurrent) { + super.withIsCurrent(isCurrent); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withApiRevisionDescription(String apiRevisionDescription) { + super.withApiRevisionDescription(apiRevisionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withApiVersionDescription(String apiVersionDescription) { + super.withApiVersionDescription(apiVersionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withApiVersionSetId(String apiVersionSetId) { + super.withApiVersionSetId(apiVersionSetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (path() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property path in model ApiContractProperties")); + } + if (apiVersionSet() != null) { + apiVersionSet().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractUpdateProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractUpdateProperties.java new file mode 100644 index 0000000000000..572b10a8703bc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiContractUpdateProperties.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** API update contract properties. */ +@Fluent +public final class ApiContractUpdateProperties extends ApiEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiContractUpdateProperties.class); + + /* + * API name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Absolute URL of the backend service implementing this API. + */ + @JsonProperty(value = "serviceUrl") + private String serviceUrl; + + /* + * Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API + * endpoint base URL specified during the service instance creation to form + * a public URL for this API. + */ + @JsonProperty(value = "path") + private String path; + + /* + * Describes on which protocols the operations in this API can be invoked. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * Get the displayName property: API name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: API name. + * + * @param displayName the displayName value to set. + * @return the ApiContractUpdateProperties object itself. + */ + public ApiContractUpdateProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the serviceUrl property: Absolute URL of the backend service implementing this API. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Set the serviceUrl property: Absolute URL of the backend service implementing this API. + * + * @param serviceUrl the serviceUrl value to set. + * @return the ApiContractUpdateProperties object itself. + */ + public ApiContractUpdateProperties withServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + return this; + } + + /** + * Get the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @param path the path value to set. + * @return the ApiContractUpdateProperties object itself. + */ + public ApiContractUpdateProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @param protocols the protocols value to set. + * @return the ApiContractUpdateProperties object itself. + */ + public ApiContractUpdateProperties withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withAuthenticationSettings( + AuthenticationSettingsContract authenticationSettings) { + super.withAuthenticationSettings(authenticationSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + super.withSubscriptionKeyParameterNames(subscriptionKeyParameterNames); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withApiType(ApiType apiType) { + super.withApiType(apiType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withApiRevision(String apiRevision) { + super.withApiRevision(apiRevision); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withApiVersion(String apiVersion) { + super.withApiVersion(apiVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withIsCurrent(Boolean isCurrent) { + super.withIsCurrent(isCurrent); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withApiRevisionDescription(String apiRevisionDescription) { + super.withApiRevisionDescription(apiRevisionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withApiVersionDescription(String apiVersionDescription) { + super.withApiVersionDescription(apiVersionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withApiVersionSetId(String apiVersionSetId) { + super.withApiVersionSetId(apiVersionSetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiContractUpdateProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateParameter.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateParameter.java new file mode 100644 index 0000000000000..f8e692712af07 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateParameter.java @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API Create or Update Parameters. */ +@JsonFlatten +@Fluent +public class ApiCreateOrUpdateParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiCreateOrUpdateParameter.class); + + /* + * Description of the API. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Collection of authentication settings included into this API. + */ + @JsonProperty(value = "properties.authenticationSettings") + private AuthenticationSettingsContract authenticationSettings; + + /* + * Protocols over which API is made available. + */ + @JsonProperty(value = "properties.subscriptionKeyParameterNames") + private SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames; + + /* + * Type of API. + */ + @JsonProperty(value = "properties.type") + private ApiType apiType; + + /* + * Describes the Revision of the Api. If no value is provided, default + * revision 1 is created + */ + @JsonProperty(value = "properties.apiRevision") + private String apiRevision; + + /* + * Indicates the Version identifier of the API if the API is versioned + */ + @JsonProperty(value = "properties.apiVersion") + private String apiVersion; + + /* + * Indicates if API revision is current api revision. + */ + @JsonProperty(value = "properties.isCurrent") + private Boolean isCurrent; + + /* + * Indicates if API revision is accessible via the gateway. + */ + @JsonProperty(value = "properties.isOnline", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOnline; + + /* + * Description of the Api Revision. + */ + @JsonProperty(value = "properties.apiRevisionDescription") + private String apiRevisionDescription; + + /* + * Description of the Api Version. + */ + @JsonProperty(value = "properties.apiVersionDescription") + private String apiVersionDescription; + + /* + * A resource identifier for the related ApiVersionSet. + */ + @JsonProperty(value = "properties.apiVersionSetId") + private String apiVersionSetId; + + /* + * Specifies whether an API or Product subscription is required for + * accessing the API. + */ + @JsonProperty(value = "properties.subscriptionRequired") + private Boolean subscriptionRequired; + + /* + * API identifier of the source API. + */ + @JsonProperty(value = "properties.sourceApiId") + private String sourceApiId; + + /* + * API name. Must be 1 to 300 characters long. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Absolute URL of the backend service implementing this API. Cannot be + * more than 2000 characters long. + */ + @JsonProperty(value = "properties.serviceUrl") + private String serviceUrl; + + /* + * Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API + * endpoint base URL specified during the service instance creation to form + * a public URL for this API. + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * Describes on which protocols the operations in this API can be invoked. + */ + @JsonProperty(value = "properties.protocols") + private List protocols; + + /* + * Version set details + */ + @JsonProperty(value = "properties.apiVersionSet") + private ApiVersionSetContractDetails apiVersionSet; + + /* + * Content value when Importing an API. + */ + @JsonProperty(value = "properties.value") + private String value; + + /* + * Format of the Content in which the API is getting imported. + */ + @JsonProperty(value = "properties.format") + private ContentFormat format; + + /* + * Criteria to limit import of WSDL to a subset of the document. + */ + @JsonProperty(value = "properties.wsdlSelector") + private ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector; + + /* + * Type of Api to create. + * * `http` creates a SOAP to REST API + * * `soap` creates a SOAP pass-through API . + */ + @JsonProperty(value = "properties.apiType") + private SoapApiType soapApiType; + + /** + * Get the description property: Description of the API. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the API. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authenticationSettings property: Collection of authentication settings included into this API. + * + * @return the authenticationSettings value. + */ + public AuthenticationSettingsContract authenticationSettings() { + return this.authenticationSettings; + } + + /** + * Set the authenticationSettings property: Collection of authentication settings included into this API. + * + * @param authenticationSettings the authenticationSettings value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withAuthenticationSettings( + AuthenticationSettingsContract authenticationSettings) { + this.authenticationSettings = authenticationSettings; + return this; + } + + /** + * Get the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @return the subscriptionKeyParameterNames value. + */ + public SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames() { + return this.subscriptionKeyParameterNames; + } + + /** + * Set the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @param subscriptionKeyParameterNames the subscriptionKeyParameterNames value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + this.subscriptionKeyParameterNames = subscriptionKeyParameterNames; + return this; + } + + /** + * Get the apiType property: Type of API. + * + * @return the apiType value. + */ + public ApiType apiType() { + return this.apiType; + } + + /** + * Set the apiType property: Type of API. + * + * @param apiType the apiType value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiType(ApiType apiType) { + this.apiType = apiType; + return this; + } + + /** + * Get the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @return the apiRevision value. + */ + public String apiRevision() { + return this.apiRevision; + } + + /** + * Set the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @param apiRevision the apiRevision value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiRevision(String apiRevision) { + this.apiRevision = apiRevision; + return this; + } + + /** + * Get the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @param apiVersion the apiVersion value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get the isCurrent property: Indicates if API revision is current api revision. + * + * @return the isCurrent value. + */ + public Boolean isCurrent() { + return this.isCurrent; + } + + /** + * Set the isCurrent property: Indicates if API revision is current api revision. + * + * @param isCurrent the isCurrent value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withIsCurrent(Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get the isOnline property: Indicates if API revision is accessible via the gateway. + * + * @return the isOnline value. + */ + public Boolean isOnline() { + return this.isOnline; + } + + /** + * Get the apiRevisionDescription property: Description of the Api Revision. + * + * @return the apiRevisionDescription value. + */ + public String apiRevisionDescription() { + return this.apiRevisionDescription; + } + + /** + * Set the apiRevisionDescription property: Description of the Api Revision. + * + * @param apiRevisionDescription the apiRevisionDescription value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiRevisionDescription(String apiRevisionDescription) { + this.apiRevisionDescription = apiRevisionDescription; + return this; + } + + /** + * Get the apiVersionDescription property: Description of the Api Version. + * + * @return the apiVersionDescription value. + */ + public String apiVersionDescription() { + return this.apiVersionDescription; + } + + /** + * Set the apiVersionDescription property: Description of the Api Version. + * + * @param apiVersionDescription the apiVersionDescription value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiVersionDescription(String apiVersionDescription) { + this.apiVersionDescription = apiVersionDescription; + return this; + } + + /** + * Get the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @return the apiVersionSetId value. + */ + public String apiVersionSetId() { + return this.apiVersionSetId; + } + + /** + * Set the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @param apiVersionSetId the apiVersionSetId value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiVersionSetId(String apiVersionSetId) { + this.apiVersionSetId = apiVersionSetId; + return this; + } + + /** + * Get the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Get the sourceApiId property: API identifier of the source API. + * + * @return the sourceApiId value. + */ + public String sourceApiId() { + return this.sourceApiId; + } + + /** + * Set the sourceApiId property: API identifier of the source API. + * + * @param sourceApiId the sourceApiId value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withSourceApiId(String sourceApiId) { + this.sourceApiId = sourceApiId; + return this; + } + + /** + * Get the displayName property: API name. Must be 1 to 300 characters long. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: API name. Must be 1 to 300 characters long. + * + * @param displayName the displayName value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Set the serviceUrl property: Absolute URL of the backend service implementing this API. Cannot be more than 2000 + * characters long. + * + * @param serviceUrl the serviceUrl value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + return this; + } + + /** + * Get the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @param path the path value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @param protocols the protocols value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the apiVersionSet property: Version set details. + * + * @return the apiVersionSet value. + */ + public ApiVersionSetContractDetails apiVersionSet() { + return this.apiVersionSet; + } + + /** + * Set the apiVersionSet property: Version set details. + * + * @param apiVersionSet the apiVersionSet value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withApiVersionSet(ApiVersionSetContractDetails apiVersionSet) { + this.apiVersionSet = apiVersionSet; + return this; + } + + /** + * Get the value property: Content value when Importing an API. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Content value when Importing an API. + * + * @param value the value value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the format property: Format of the Content in which the API is getting imported. + * + * @return the format value. + */ + public ContentFormat format() { + return this.format; + } + + /** + * Set the format property: Format of the Content in which the API is getting imported. + * + * @param format the format value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withFormat(ContentFormat format) { + this.format = format; + return this; + } + + /** + * Get the wsdlSelector property: Criteria to limit import of WSDL to a subset of the document. + * + * @return the wsdlSelector value. + */ + public ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector() { + return this.wsdlSelector; + } + + /** + * Set the wsdlSelector property: Criteria to limit import of WSDL to a subset of the document. + * + * @param wsdlSelector the wsdlSelector value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withWsdlSelector(ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector) { + this.wsdlSelector = wsdlSelector; + return this; + } + + /** + * Get the soapApiType property: Type of Api to create. * `http` creates a SOAP to REST API * `soap` creates a SOAP + * pass-through API . + * + * @return the soapApiType value. + */ + public SoapApiType soapApiType() { + return this.soapApiType; + } + + /** + * Set the soapApiType property: Type of Api to create. * `http` creates a SOAP to REST API * `soap` creates a SOAP + * pass-through API . + * + * @param soapApiType the soapApiType value to set. + * @return the ApiCreateOrUpdateParameter object itself. + */ + public ApiCreateOrUpdateParameter withSoapApiType(SoapApiType soapApiType) { + this.soapApiType = soapApiType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationSettings() != null) { + authenticationSettings().validate(); + } + if (subscriptionKeyParameterNames() != null) { + subscriptionKeyParameterNames().validate(); + } + if (apiVersionSet() != null) { + apiVersionSet().validate(); + } + if (wsdlSelector() != null) { + wsdlSelector().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateProperties.java new file mode 100644 index 0000000000000..7767dfb116f70 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdateProperties.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Api Create or Update Properties. */ +@Fluent +public final class ApiCreateOrUpdateProperties extends ApiContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiCreateOrUpdateProperties.class); + + /* + * Content value when Importing an API. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Format of the Content in which the API is getting imported. + */ + @JsonProperty(value = "format") + private ContentFormat format; + + /* + * Criteria to limit import of WSDL to a subset of the document. + */ + @JsonProperty(value = "wsdlSelector") + private ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector; + + /* + * Type of Api to create. + * * `http` creates a SOAP to REST API + * * `soap` creates a SOAP pass-through API . + */ + @JsonProperty(value = "apiType") + private SoapApiType soapApiType; + + /** + * Get the value property: Content value when Importing an API. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Content value when Importing an API. + * + * @param value the value value to set. + * @return the ApiCreateOrUpdateProperties object itself. + */ + public ApiCreateOrUpdateProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the format property: Format of the Content in which the API is getting imported. + * + * @return the format value. + */ + public ContentFormat format() { + return this.format; + } + + /** + * Set the format property: Format of the Content in which the API is getting imported. + * + * @param format the format value to set. + * @return the ApiCreateOrUpdateProperties object itself. + */ + public ApiCreateOrUpdateProperties withFormat(ContentFormat format) { + this.format = format; + return this; + } + + /** + * Get the wsdlSelector property: Criteria to limit import of WSDL to a subset of the document. + * + * @return the wsdlSelector value. + */ + public ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector() { + return this.wsdlSelector; + } + + /** + * Set the wsdlSelector property: Criteria to limit import of WSDL to a subset of the document. + * + * @param wsdlSelector the wsdlSelector value to set. + * @return the ApiCreateOrUpdateProperties object itself. + */ + public ApiCreateOrUpdateProperties withWsdlSelector(ApiCreateOrUpdatePropertiesWsdlSelector wsdlSelector) { + this.wsdlSelector = wsdlSelector; + return this; + } + + /** + * Get the soapApiType property: Type of Api to create. * `http` creates a SOAP to REST API * `soap` creates a SOAP + * pass-through API . + * + * @return the soapApiType value. + */ + public SoapApiType soapApiType() { + return this.soapApiType; + } + + /** + * Set the soapApiType property: Type of Api to create. * `http` creates a SOAP to REST API * `soap` creates a SOAP + * pass-through API . + * + * @param soapApiType the soapApiType value to set. + * @return the ApiCreateOrUpdateProperties object itself. + */ + public ApiCreateOrUpdateProperties withSoapApiType(SoapApiType soapApiType) { + this.soapApiType = soapApiType; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withSourceApiId(String sourceApiId) { + super.withSourceApiId(sourceApiId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withServiceUrl(String serviceUrl) { + super.withServiceUrl(serviceUrl); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withPath(String path) { + super.withPath(path); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withProtocols(List protocols) { + super.withProtocols(protocols); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiVersionSet(ApiVersionSetContractDetails apiVersionSet) { + super.withApiVersionSet(apiVersionSet); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withAuthenticationSettings( + AuthenticationSettingsContract authenticationSettings) { + super.withAuthenticationSettings(authenticationSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + super.withSubscriptionKeyParameterNames(subscriptionKeyParameterNames); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiType(ApiType apiType) { + super.withApiType(apiType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiRevision(String apiRevision) { + super.withApiRevision(apiRevision); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiVersion(String apiVersion) { + super.withApiVersion(apiVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withIsCurrent(Boolean isCurrent) { + super.withIsCurrent(isCurrent); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiRevisionDescription(String apiRevisionDescription) { + super.withApiRevisionDescription(apiRevisionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiVersionDescription(String apiVersionDescription) { + super.withApiVersionDescription(apiVersionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withApiVersionSetId(String apiVersionSetId) { + super.withApiVersionSetId(apiVersionSetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiCreateOrUpdateProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (wsdlSelector() != null) { + wsdlSelector().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdatePropertiesWsdlSelector.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdatePropertiesWsdlSelector.java new file mode 100644 index 0000000000000..864789c094b96 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiCreateOrUpdatePropertiesWsdlSelector.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.apimanagement.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; + +/** Criteria to limit import of WSDL to a subset of the document. */ +@Fluent +public final class ApiCreateOrUpdatePropertiesWsdlSelector { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiCreateOrUpdatePropertiesWsdlSelector.class); + + /* + * Name of service to import from WSDL + */ + @JsonProperty(value = "wsdlServiceName") + private String wsdlServiceName; + + /* + * Name of endpoint(port) to import from WSDL + */ + @JsonProperty(value = "wsdlEndpointName") + private String wsdlEndpointName; + + /** + * Get the wsdlServiceName property: Name of service to import from WSDL. + * + * @return the wsdlServiceName value. + */ + public String wsdlServiceName() { + return this.wsdlServiceName; + } + + /** + * Set the wsdlServiceName property: Name of service to import from WSDL. + * + * @param wsdlServiceName the wsdlServiceName value to set. + * @return the ApiCreateOrUpdatePropertiesWsdlSelector object itself. + */ + public ApiCreateOrUpdatePropertiesWsdlSelector withWsdlServiceName(String wsdlServiceName) { + this.wsdlServiceName = wsdlServiceName; + return this; + } + + /** + * Get the wsdlEndpointName property: Name of endpoint(port) to import from WSDL. + * + * @return the wsdlEndpointName value. + */ + public String wsdlEndpointName() { + return this.wsdlEndpointName; + } + + /** + * Set the wsdlEndpointName property: Name of endpoint(port) to import from WSDL. + * + * @param wsdlEndpointName the wsdlEndpointName value to set. + * @return the ApiCreateOrUpdatePropertiesWsdlSelector object itself. + */ + public ApiCreateOrUpdatePropertiesWsdlSelector withWsdlEndpointName(String wsdlEndpointName) { + this.wsdlEndpointName = wsdlEndpointName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnostics.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnostics.java new file mode 100644 index 0000000000000..9a6264632d447 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnostics.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiDiagnostics. */ +public interface ApiDiagnostics { + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all diagnostics of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String diagnosticId); + + /** + * Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic for an API specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context); + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + DiagnosticContract get(String resourceGroupName, String serviceName, String apiId, String diagnosticId); + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String diagnosticId, Context context); + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String diagnosticId, String ifMatch); + + /** + * Deletes the specified Diagnostic from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String diagnosticId, + String ifMatch, + Context context); + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + DiagnosticContract getById(String id); + + /** + * Gets the details of the Diagnostic for an API specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic for an API specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Diagnostic from an API. + * + * @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 the specified Diagnostic from an API. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new DiagnosticContract resource. + * + * @param name resource name. + * @return the first stage of the new DiagnosticContract definition. + */ + DiagnosticContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..cabe6c9e897ac --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateHeaders.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.apimanagement.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 ApiDiagnosticsCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiDiagnosticsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDiagnosticsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiDiagnosticsCreateOrUpdateHeaders object itself. + */ + public ApiDiagnosticsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..0f20b8b1256fe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiDiagnosticsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiDiagnosticsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiDiagnosticsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiDiagnosticsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + DiagnosticContractInner value, + ApiDiagnosticsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public DiagnosticContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..9ee7523411d47 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagHeaders.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.apimanagement.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 ApiDiagnosticsGetEntityTagHeaders model. */ +@Fluent +public final class ApiDiagnosticsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDiagnosticsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiDiagnosticsGetEntityTagHeaders object itself. + */ + public ApiDiagnosticsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagResponse.java new file mode 100644 index 0000000000000..5260f9cdd8494 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiDiagnosticsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiDiagnosticsGetEntityTagResponse. + * + * @param request the request which resulted in this ApiDiagnosticsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiDiagnosticsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiDiagnosticsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetHeaders.java new file mode 100644 index 0000000000000..9bfa21aa0ffd8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetHeaders.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.apimanagement.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 ApiDiagnosticsGetHeaders model. */ +@Fluent +public final class ApiDiagnosticsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDiagnosticsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiDiagnosticsGetHeaders object itself. + */ + public ApiDiagnosticsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetResponse.java new file mode 100644 index 0000000000000..79762f1061776 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiDiagnosticsGetResponse extends ResponseBase { + /** + * Creates an instance of ApiDiagnosticsGetResponse. + * + * @param request the request which resulted in this ApiDiagnosticsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiDiagnosticsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + DiagnosticContractInner value, + ApiDiagnosticsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public DiagnosticContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateHeaders.java new file mode 100644 index 0000000000000..dde0e68d0a2ca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateHeaders.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.apimanagement.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 ApiDiagnosticsUpdateHeaders model. */ +@Fluent +public final class ApiDiagnosticsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDiagnosticsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiDiagnosticsUpdateHeaders object itself. + */ + public ApiDiagnosticsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateResponse.java new file mode 100644 index 0000000000000..161c36cb3847a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiDiagnosticsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Contains all response data for the update operation. */ +public final class ApiDiagnosticsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiDiagnosticsUpdateResponse. + * + * @param request the request which resulted in this ApiDiagnosticsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiDiagnosticsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + DiagnosticContractInner value, + ApiDiagnosticsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public DiagnosticContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiEntityBaseContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiEntityBaseContract.java new file mode 100644 index 0000000000000..1df948a89891e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiEntityBaseContract.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** API base contract details. */ +@Fluent +public class ApiEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiEntityBaseContract.class); + + /* + * Description of the API. May include HTML formatting tags. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Collection of authentication settings included into this API. + */ + @JsonProperty(value = "authenticationSettings") + private AuthenticationSettingsContract authenticationSettings; + + /* + * Protocols over which API is made available. + */ + @JsonProperty(value = "subscriptionKeyParameterNames") + private SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames; + + /* + * Type of API. + */ + @JsonProperty(value = "type") + private ApiType apiType; + + /* + * Describes the Revision of the Api. If no value is provided, default + * revision 1 is created + */ + @JsonProperty(value = "apiRevision") + private String apiRevision; + + /* + * Indicates the Version identifier of the API if the API is versioned + */ + @JsonProperty(value = "apiVersion") + private String apiVersion; + + /* + * Indicates if API revision is current api revision. + */ + @JsonProperty(value = "isCurrent") + private Boolean isCurrent; + + /* + * Indicates if API revision is accessible via the gateway. + */ + @JsonProperty(value = "isOnline", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOnline; + + /* + * Description of the Api Revision. + */ + @JsonProperty(value = "apiRevisionDescription") + private String apiRevisionDescription; + + /* + * Description of the Api Version. + */ + @JsonProperty(value = "apiVersionDescription") + private String apiVersionDescription; + + /* + * A resource identifier for the related ApiVersionSet. + */ + @JsonProperty(value = "apiVersionSetId") + private String apiVersionSetId; + + /* + * Specifies whether an API or Product subscription is required for + * accessing the API. + */ + @JsonProperty(value = "subscriptionRequired") + private Boolean subscriptionRequired; + + /** + * Get the description property: Description of the API. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the API. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authenticationSettings property: Collection of authentication settings included into this API. + * + * @return the authenticationSettings value. + */ + public AuthenticationSettingsContract authenticationSettings() { + return this.authenticationSettings; + } + + /** + * Set the authenticationSettings property: Collection of authentication settings included into this API. + * + * @param authenticationSettings the authenticationSettings value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings) { + this.authenticationSettings = authenticationSettings; + return this; + } + + /** + * Get the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @return the subscriptionKeyParameterNames value. + */ + public SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames() { + return this.subscriptionKeyParameterNames; + } + + /** + * Set the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @param subscriptionKeyParameterNames the subscriptionKeyParameterNames value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + this.subscriptionKeyParameterNames = subscriptionKeyParameterNames; + return this; + } + + /** + * Get the apiType property: Type of API. + * + * @return the apiType value. + */ + public ApiType apiType() { + return this.apiType; + } + + /** + * Set the apiType property: Type of API. + * + * @param apiType the apiType value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withApiType(ApiType apiType) { + this.apiType = apiType; + return this; + } + + /** + * Get the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @return the apiRevision value. + */ + public String apiRevision() { + return this.apiRevision; + } + + /** + * Set the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @param apiRevision the apiRevision value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withApiRevision(String apiRevision) { + this.apiRevision = apiRevision; + return this; + } + + /** + * Get the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @param apiVersion the apiVersion value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get the isCurrent property: Indicates if API revision is current api revision. + * + * @return the isCurrent value. + */ + public Boolean isCurrent() { + return this.isCurrent; + } + + /** + * Set the isCurrent property: Indicates if API revision is current api revision. + * + * @param isCurrent the isCurrent value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withIsCurrent(Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get the isOnline property: Indicates if API revision is accessible via the gateway. + * + * @return the isOnline value. + */ + public Boolean isOnline() { + return this.isOnline; + } + + /** + * Get the apiRevisionDescription property: Description of the Api Revision. + * + * @return the apiRevisionDescription value. + */ + public String apiRevisionDescription() { + return this.apiRevisionDescription; + } + + /** + * Set the apiRevisionDescription property: Description of the Api Revision. + * + * @param apiRevisionDescription the apiRevisionDescription value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withApiRevisionDescription(String apiRevisionDescription) { + this.apiRevisionDescription = apiRevisionDescription; + return this; + } + + /** + * Get the apiVersionDescription property: Description of the Api Version. + * + * @return the apiVersionDescription value. + */ + public String apiVersionDescription() { + return this.apiVersionDescription; + } + + /** + * Set the apiVersionDescription property: Description of the Api Version. + * + * @param apiVersionDescription the apiVersionDescription value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withApiVersionDescription(String apiVersionDescription) { + this.apiVersionDescription = apiVersionDescription; + return this; + } + + /** + * Get the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @return the apiVersionSetId value. + */ + public String apiVersionSetId() { + return this.apiVersionSetId; + } + + /** + * Set the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @param apiVersionSetId the apiVersionSetId value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withApiVersionSetId(String apiVersionSetId) { + this.apiVersionSetId = apiVersionSetId; + return this; + } + + /** + * Get the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ApiEntityBaseContract object itself. + */ + public ApiEntityBaseContract withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationSettings() != null) { + authenticationSettings().validate(); + } + if (subscriptionKeyParameterNames() != null) { + subscriptionKeyParameterNames().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResult.java new file mode 100644 index 0000000000000..c9988ddd96d2f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResult.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiExportResultInner; + +/** An immutable client-side representation of ApiExportResult. */ +public interface ApiExportResult { + /** + * Gets the id property: ResourceId of the API which was exported. + * + * @return the id value. + */ + String id(); + + /** + * Gets the exportResultFormat property: Format in which the Api Details are exported to the Storage Blob with Sas + * Key valid for 5 minutes. + * + * @return the exportResultFormat value. + */ + ExportResultFormat exportResultFormat(); + + /** + * Gets the value property: The object defining the schema of the exported Api Detail. + * + * @return the value value. + */ + ApiExportResultValue value(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiExportResultInner object. + * + * @return the inner object. + */ + ApiExportResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResultValue.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResultValue.java new file mode 100644 index 0000000000000..01e5a5bbdf683 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExportResultValue.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 object defining the schema of the exported Api Detail. */ +@Fluent +public final class ApiExportResultValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiExportResultValue.class); + + /* + * Link to the Storage Blob containing the result of the export operation. + * The Blob Uri is only valid for 5 minutes. + */ + @JsonProperty(value = "link") + private String link; + + /** + * Get the link property: Link to the Storage Blob containing the result of the export operation. The Blob Uri is + * only valid for 5 minutes. + * + * @return the link value. + */ + public String link() { + return this.link; + } + + /** + * Set the link property: Link to the Storage Blob containing the result of the export operation. The Blob Uri is + * only valid for 5 minutes. + * + * @param link the link value to set. + * @return the ApiExportResultValue object itself. + */ + public ApiExportResultValue withLink(String link) { + this.link = link; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExports.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExports.java new file mode 100644 index 0000000000000..58a7dd1b594a3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiExports.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApiExports. */ +public interface ApiExports { + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + ApiExportResult get( + String resourceGroupName, String serviceName, String apiId, ExportFormat format, ExportApi export); + + /** + * Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key + * valid for 5 minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param format Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. + * @param export Query parameter required to export the API details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier in the format specified to the Storage Blob with SAS + * Key valid for 5 minutes. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + ExportFormat format, + ExportApi export, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachments.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachments.java new file mode 100644 index 0000000000000..be82c5d63c9a0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachments.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiIssueAttachments. */ +public interface ApiIssueAttachments { + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Lists all attachments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Attachment list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId); + + /** + * Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Attachment for an API specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context); + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + IssueAttachmentContract get( + String resourceGroupName, String serviceName, String apiId, String issueId, String attachmentId); + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + Context context); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param attachmentId Attachment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String attachmentId, + String ifMatch, + Context context); + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + IssueAttachmentContract getById(String id); + + /** + * Gets the details of the issue Attachment for an API specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Attachment for an API specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified comment from an Issue. + * + * @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 the specified comment from an Issue. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new IssueAttachmentContract resource. + * + * @param name resource name. + * @return the first stage of the new IssueAttachmentContract definition. + */ + IssueAttachmentContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..6689e9d9b7d34 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateHeaders.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.apimanagement.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 ApiIssueAttachmentsCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiIssueAttachmentsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueAttachmentsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssueAttachmentsCreateOrUpdateHeaders object itself. + */ + public ApiIssueAttachmentsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..3db4071aafd75 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiIssueAttachmentsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssueAttachmentsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiIssueAttachmentsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssueAttachmentsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueAttachmentContractInner value, + ApiIssueAttachmentsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueAttachmentContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..e38cd5aff5c2b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagHeaders.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.apimanagement.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 ApiIssueAttachmentsGetEntityTagHeaders model. */ +@Fluent +public final class ApiIssueAttachmentsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueAttachmentsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssueAttachmentsGetEntityTagHeaders object itself. + */ + public ApiIssueAttachmentsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagResponse.java new file mode 100644 index 0000000000000..5a74fb8316b20 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiIssueAttachmentsGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssueAttachmentsGetEntityTagResponse. + * + * @param request the request which resulted in this ApiIssueAttachmentsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssueAttachmentsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiIssueAttachmentsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetHeaders.java new file mode 100644 index 0000000000000..97175c092b28e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetHeaders.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.apimanagement.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 ApiIssueAttachmentsGetHeaders model. */ +@Fluent +public final class ApiIssueAttachmentsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueAttachmentsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssueAttachmentsGetHeaders object itself. + */ + public ApiIssueAttachmentsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetResponse.java new file mode 100644 index 0000000000000..d684b108d21df --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueAttachmentsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiIssueAttachmentsGetResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssueAttachmentsGetResponse. + * + * @param request the request which resulted in this ApiIssueAttachmentsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssueAttachmentsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueAttachmentContractInner value, + ApiIssueAttachmentsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueAttachmentContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueComments.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueComments.java new file mode 100644 index 0000000000000..ef52141e420a7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueComments.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiIssueComments. */ +public interface ApiIssueComments { + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Lists all comments for the Issue associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue Comment list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId, String commentId); + + /** + * Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the issue Comment for an API specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context); + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + IssueCommentContract get( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId); + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String commentId, Context context); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String issueId, String commentId, String ifMatch); + + /** + * Deletes the specified comment from an Issue. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param commentId Comment identifier within an Issue. Must be unique in the current Issue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + String commentId, + String ifMatch, + Context context); + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + IssueCommentContract getById(String id); + + /** + * Gets the details of the issue Comment for an API specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the issue Comment for an API specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified comment from an Issue. + * + * @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 the specified comment from an Issue. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new IssueCommentContract resource. + * + * @param name resource name. + * @return the first stage of the new IssueCommentContract definition. + */ + IssueCommentContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..46c7959065e10 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateHeaders.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.apimanagement.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 ApiIssueCommentsCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiIssueCommentsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueCommentsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssueCommentsCreateOrUpdateHeaders object itself. + */ + public ApiIssueCommentsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..0b7efd4d74a93 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiIssueCommentsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssueCommentsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiIssueCommentsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssueCommentsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueCommentContractInner value, + ApiIssueCommentsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueCommentContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..bceeaa2ce5508 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagHeaders.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.apimanagement.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 ApiIssueCommentsGetEntityTagHeaders model. */ +@Fluent +public final class ApiIssueCommentsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueCommentsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssueCommentsGetEntityTagHeaders object itself. + */ + public ApiIssueCommentsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagResponse.java new file mode 100644 index 0000000000000..0cb98498059a0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiIssueCommentsGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssueCommentsGetEntityTagResponse. + * + * @param request the request which resulted in this ApiIssueCommentsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssueCommentsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiIssueCommentsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetHeaders.java new file mode 100644 index 0000000000000..a9f2711bc1bb1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetHeaders.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.apimanagement.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 ApiIssueCommentsGetHeaders model. */ +@Fluent +public final class ApiIssueCommentsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssueCommentsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssueCommentsGetHeaders object itself. + */ + public ApiIssueCommentsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetResponse.java new file mode 100644 index 0000000000000..cfffbf575f97d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssueCommentsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiIssueCommentsGetResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssueCommentsGetResponse. + * + * @param request the request which resulted in this ApiIssueCommentsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssueCommentsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueCommentContractInner value, + ApiIssueCommentsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueCommentContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssues.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssues.java new file mode 100644 index 0000000000000..b25a9b394e545 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssues.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiIssues. */ +public interface ApiIssues { + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all issues associated with the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param expandCommentsAttachments Expand the comment attachments. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Boolean expandCommentsAttachments, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Gets the entity state (Etag) version of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Issue for an API specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, Context context); + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + IssueContract get(String resourceGroupName, String serviceName, String apiId, String issueId); + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param expandCommentsAttachments Expand the comment attachments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String issueId, + Boolean expandCommentsAttachments, + Context context); + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String issueId, String ifMatch); + + /** + * Deletes the specified Issue from an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String issueId, String ifMatch, Context context); + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + IssueContract getById(String id); + + /** + * Gets the details of the Issue for an API specified by its identifier. + * + * @param id the resource ID. + * @param expandCommentsAttachments Expand the comment attachments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Issue for an API specified by its identifier. + */ + Response getByIdWithResponse(String id, Boolean expandCommentsAttachments, Context context); + + /** + * Deletes the specified Issue from an API. + * + * @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 the specified Issue from an API. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new IssueContract resource. + * + * @param name resource name. + * @return the first stage of the new IssueContract definition. + */ + IssueContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..792f18e8e99c6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateHeaders.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.apimanagement.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 ApiIssuesCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiIssuesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssuesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssuesCreateOrUpdateHeaders object itself. + */ + public ApiIssuesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..69e081042efd5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiIssuesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiIssuesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiIssuesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssuesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueContractInner value, + ApiIssuesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..631089cb41bd0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagHeaders.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.apimanagement.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 ApiIssuesGetEntityTagHeaders model. */ +@Fluent +public final class ApiIssuesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssuesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssuesGetEntityTagHeaders object itself. + */ + public ApiIssuesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagResponse.java new file mode 100644 index 0000000000000..9ef24cee6f678 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiIssuesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiIssuesGetEntityTagResponse. + * + * @param request the request which resulted in this ApiIssuesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssuesGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, ApiIssuesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetHeaders.java new file mode 100644 index 0000000000000..1e681d62e5c7e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetHeaders.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.apimanagement.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 ApiIssuesGetHeaders model. */ +@Fluent +public final class ApiIssuesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssuesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssuesGetHeaders object itself. + */ + public ApiIssuesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetResponse.java new file mode 100644 index 0000000000000..4fd8b8608c995 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiIssuesGetResponse extends ResponseBase { + /** + * Creates an instance of ApiIssuesGetResponse. + * + * @param request the request which resulted in this ApiIssuesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssuesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueContractInner value, + ApiIssuesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateHeaders.java new file mode 100644 index 0000000000000..9787365d2dfdd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateHeaders.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.apimanagement.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 ApiIssuesUpdateHeaders model. */ +@Fluent +public final class ApiIssuesUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiIssuesUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiIssuesUpdateHeaders object itself. + */ + public ApiIssuesUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateResponse.java new file mode 100644 index 0000000000000..a85a15f026f87 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiIssuesUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; + +/** Contains all response data for the update operation. */ +public final class ApiIssuesUpdateResponse extends ResponseBase { + /** + * Creates an instance of ApiIssuesUpdateResponse. + * + * @param request the request which resulted in this ApiIssuesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiIssuesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueContractInner value, + ApiIssuesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementOperations.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementOperations.java new file mode 100644 index 0000000000000..df904d74683ee --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementOperations.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApiManagementOperations. */ +public interface ApiManagementOperations { + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.ApiManagement provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceApplyNetworkConfigurationParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceApplyNetworkConfigurationParameters.java new file mode 100644 index 0000000000000..83036eba6227f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceApplyNetworkConfigurationParameters.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.apimanagement.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; + +/** Parameter supplied to the Apply Network configuration operation. */ +@Fluent +public final class ApiManagementServiceApplyNetworkConfigurationParameters { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApiManagementServiceApplyNetworkConfigurationParameters.class); + + /* + * Location of the Api Management service to update for a multi-region + * service. For a service deployed in a single region, this parameter is + * not required. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location property: Location of the Api Management service to update for a multi-region service. For a + * service deployed in a single region, this parameter is not required. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the Api Management service to update for a multi-region service. For a + * service deployed in a single region, this parameter is not required. + * + * @param location the location value to set. + * @return the ApiManagementServiceApplyNetworkConfigurationParameters object itself. + */ + public ApiManagementServiceApplyNetworkConfigurationParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBackupRestoreParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBackupRestoreParameters.java new file mode 100644 index 0000000000000..08f212d8a50b4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBackupRestoreParameters.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Backup/Restore of an API Management service operation. */ +@Fluent +public final class ApiManagementServiceBackupRestoreParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceBackupRestoreParameters.class); + + /* + * Azure Cloud Storage account (used to place/retrieve the backup) name. + */ + @JsonProperty(value = "storageAccount", required = true) + private String storageAccount; + + /* + * Azure Cloud Storage account (used to place/retrieve the backup) access + * key. + */ + @JsonProperty(value = "accessKey", required = true) + private String accessKey; + + /* + * Azure Cloud Storage blob container name used to place/retrieve the + * backup. + */ + @JsonProperty(value = "containerName", required = true) + private String containerName; + + /* + * The name of the backup file to create. + */ + @JsonProperty(value = "backupName", required = true) + private String backupName; + + /** + * Get the storageAccount property: Azure Cloud Storage account (used to place/retrieve the backup) name. + * + * @return the storageAccount value. + */ + public String storageAccount() { + return this.storageAccount; + } + + /** + * Set the storageAccount property: Azure Cloud Storage account (used to place/retrieve the backup) name. + * + * @param storageAccount the storageAccount value to set. + * @return the ApiManagementServiceBackupRestoreParameters object itself. + */ + public ApiManagementServiceBackupRestoreParameters withStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get the accessKey property: Azure Cloud Storage account (used to place/retrieve the backup) access key. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: Azure Cloud Storage account (used to place/retrieve the backup) access key. + * + * @param accessKey the accessKey value to set. + * @return the ApiManagementServiceBackupRestoreParameters object itself. + */ + public ApiManagementServiceBackupRestoreParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the containerName property: Azure Cloud Storage blob container name used to place/retrieve the backup. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Azure Cloud Storage blob container name used to place/retrieve the backup. + * + * @param containerName the containerName value to set. + * @return the ApiManagementServiceBackupRestoreParameters object itself. + */ + public ApiManagementServiceBackupRestoreParameters withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the backupName property: The name of the backup file to create. + * + * @return the backupName value. + */ + public String backupName() { + return this.backupName; + } + + /** + * Set the backupName property: The name of the backup file to create. + * + * @param backupName the backupName value to set. + * @return the ApiManagementServiceBackupRestoreParameters object itself. + */ + public ApiManagementServiceBackupRestoreParameters withBackupName(String backupName) { + this.backupName = backupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccount() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccount in model" + + " ApiManagementServiceBackupRestoreParameters")); + } + if (accessKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accessKey in model ApiManagementServiceBackupRestoreParameters")); + } + if (containerName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property containerName in model" + + " ApiManagementServiceBackupRestoreParameters")); + } + if (backupName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backupName in model ApiManagementServiceBackupRestoreParameters")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBaseProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBaseProperties.java new file mode 100644 index 0000000000000..85ddd839a56c6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceBaseProperties.java @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Base Properties of an API Management service resource description. */ +@Fluent +public class ApiManagementServiceBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceBaseProperties.class); + + /* + * Email address from which the notification will be sent. + */ + @JsonProperty(value = "notificationSenderEmail") + private String notificationSenderEmail; + + /* + * The current provisioning state of the API Management service which can + * be one of the following: + * Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The provisioning state of the API Management service, which is targeted + * by the long running operation started on the service. + */ + @JsonProperty(value = "targetProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String targetProvisioningState; + + /* + * Creation UTC date of the API Management service.The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + */ + @JsonProperty(value = "createdAtUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAtUtc; + + /* + * Gateway URL of the API Management service. + */ + @JsonProperty(value = "gatewayUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayUrl; + + /* + * Gateway URL of the API Management service in the Default Region. + */ + @JsonProperty(value = "gatewayRegionalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayRegionalUrl; + + /* + * Publisher portal endpoint Url of the API Management service. + */ + @JsonProperty(value = "portalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String portalUrl; + + /* + * Management API endpoint URL of the API Management service. + */ + @JsonProperty(value = "managementApiUrl", access = JsonProperty.Access.WRITE_ONLY) + private String managementApiUrl; + + /* + * SCM endpoint URL of the API Management service. + */ + @JsonProperty(value = "scmUrl", access = JsonProperty.Access.WRITE_ONLY) + private String scmUrl; + + /* + * DEveloper Portal endpoint URL of the API Management service. + */ + @JsonProperty(value = "developerPortalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String developerPortalUrl; + + /* + * Custom hostname configuration of the API Management service. + */ + @JsonProperty(value = "hostnameConfigurations") + private List hostnameConfigurations; + + /* + * Public Static Load Balanced IP addresses of the API Management service + * in Primary region. Available only for Basic, Standard, Premium and + * Isolated SKU. + */ + @JsonProperty(value = "publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * Private Static Load Balanced IP addresses of the API Management service + * in Primary region which is deployed in an Internal Virtual Network. + * Available only for Basic, Standard, Premium and Isolated SKU. + */ + @JsonProperty(value = "privateIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List privateIpAddresses; + + /* + * Virtual network configuration of the API Management service. + */ + @JsonProperty(value = "virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /* + * Additional datacenter locations of the API Management service. + */ + @JsonProperty(value = "additionalLocations") + private List additionalLocations; + + /* + * Custom properties of the API Management service.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + * will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, + * 1.1 and 1.2).
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + * can be used to disable just TLS 1.1.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + * can be used to disable TLS 1.0 on an API Management service.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + * can be used to disable just TLS 1.1 for communications with + * backends.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + * can be used to disable TLS 1.0 for communications with + * backends.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + * can be used to enable HTTP2 protocol on an API Management + * service.
Not specifying any of these properties on PATCH operation + * will reset omitted properties' values to their defaults. For all the + * settings except Http2 the default value is `True` if the service was + * created on or before April 1st 2018 and `False` otherwise. Http2 + * setting's default value is `False`.

You can disable any of next + * ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + * TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + * TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be + * disabled since they are required by Azure CloudService internal + * components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 + */ + @JsonProperty(value = "customProperties") + private Map customProperties; + + /* + * List of Certificates that need to be installed in the API Management + * service. Max supported certificates that can be installed is 10. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the + * gateway. This also enables the ability to authenticate the certificate + * in the policy on the gateway. + */ + @JsonProperty(value = "enableClientCertificate") + private Boolean enableClientCertificate; + + /* + * Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + */ + @JsonProperty(value = "disableGateway") + private Boolean disableGateway; + + /* + * The type of VPN in which API Management service needs to be configured + * in. None (Default Value) means the API Management service is not part of + * any Virtual Network, External means the API Management deployment is set + * up inside a Virtual Network having an Internet Facing Endpoint, and + * Internal means that API Management deployment is setup inside a Virtual + * Network having an Intranet Facing Endpoint only. + */ + @JsonProperty(value = "virtualNetworkType") + private VirtualNetworkType virtualNetworkType; + + /* + * Control Plane Apis version constraint for the API Management service. + */ + @JsonProperty(value = "apiVersionConstraint") + private ApiVersionConstraint apiVersionConstraint; + + /* + * Undelete Api Management Service if it was previously soft-deleted. If + * this flag is specified and set to True all other properties will be + * ignored. + */ + @JsonProperty(value = "restore") + private Boolean restore; + + /** + * Get the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @return the notificationSenderEmail value. + */ + public String notificationSenderEmail() { + return this.notificationSenderEmail; + } + + /** + * Set the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @param notificationSenderEmail the notificationSenderEmail value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withNotificationSenderEmail(String notificationSenderEmail) { + this.notificationSenderEmail = notificationSenderEmail; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state of the API Management service which can be one + * of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the targetProvisioningState property: The provisioning state of the API Management service, which is targeted + * by the long running operation started on the service. + * + * @return the targetProvisioningState value. + */ + public String targetProvisioningState() { + return this.targetProvisioningState; + } + + /** + * Get the createdAtUtc property: Creation UTC date of the API Management service.The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the createdAtUtc value. + */ + public OffsetDateTime createdAtUtc() { + return this.createdAtUtc; + } + + /** + * Get the gatewayUrl property: Gateway URL of the API Management service. + * + * @return the gatewayUrl value. + */ + public String gatewayUrl() { + return this.gatewayUrl; + } + + /** + * Get the gatewayRegionalUrl property: Gateway URL of the API Management service in the Default Region. + * + * @return the gatewayRegionalUrl value. + */ + public String gatewayRegionalUrl() { + return this.gatewayRegionalUrl; + } + + /** + * Get the portalUrl property: Publisher portal endpoint Url of the API Management service. + * + * @return the portalUrl value. + */ + public String portalUrl() { + return this.portalUrl; + } + + /** + * Get the managementApiUrl property: Management API endpoint URL of the API Management service. + * + * @return the managementApiUrl value. + */ + public String managementApiUrl() { + return this.managementApiUrl; + } + + /** + * Get the scmUrl property: SCM endpoint URL of the API Management service. + * + * @return the scmUrl value. + */ + public String scmUrl() { + return this.scmUrl; + } + + /** + * Get the developerPortalUrl property: DEveloper Portal endpoint URL of the API Management service. + * + * @return the developerPortalUrl value. + */ + public String developerPortalUrl() { + return this.developerPortalUrl; + } + + /** + * Get the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @return the hostnameConfigurations value. + */ + public List hostnameConfigurations() { + return this.hostnameConfigurations; + } + + /** + * Set the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @param hostnameConfigurations the hostnameConfigurations value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withHostnameConfigurations( + List hostnameConfigurations) { + this.hostnameConfigurations = hostnameConfigurations; + return this; + } + + /** + * Get the publicIpAddresses property: Public Static Load Balanced IP addresses of the API Management service in + * Primary region. Available only for Basic, Standard, Premium and Isolated SKU. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the privateIpAddresses property: Private Static Load Balanced IP addresses of the API Management service in + * Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and + * Isolated SKU. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Get the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @return the virtualNetworkConfiguration value. + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withVirtualNetworkConfiguration( + VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @return the additionalLocations value. + */ + public List additionalLocations() { + return this.additionalLocations; + } + + /** + * Set the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @param additionalLocations the additionalLocations value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withAdditionalLocations(List additionalLocations) { + this.additionalLocations = additionalLocations; + return this; + } + + /** + * Get the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @param customProperties the customProperties value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withCustomProperties(Map customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Get the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @param certificates the certificates value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @return the enableClientCertificate value. + */ + public Boolean enableClientCertificate() { + return this.enableClientCertificate; + } + + /** + * Set the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @param enableClientCertificate the enableClientCertificate value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withEnableClientCertificate(Boolean enableClientCertificate) { + this.enableClientCertificate = enableClientCertificate; + return this; + } + + /** + * Get the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @return the disableGateway value. + */ + public Boolean disableGateway() { + return this.disableGateway; + } + + /** + * Set the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @param disableGateway the disableGateway value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withDisableGateway(Boolean disableGateway) { + this.disableGateway = disableGateway; + return this; + } + + /** + * Get the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @return the virtualNetworkType value. + */ + public VirtualNetworkType virtualNetworkType() { + return this.virtualNetworkType; + } + + /** + * Set the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @param virtualNetworkType the virtualNetworkType value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withVirtualNetworkType(VirtualNetworkType virtualNetworkType) { + this.virtualNetworkType = virtualNetworkType; + return this; + } + + /** + * Get the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @return the apiVersionConstraint value. + */ + public ApiVersionConstraint apiVersionConstraint() { + return this.apiVersionConstraint; + } + + /** + * Set the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @param apiVersionConstraint the apiVersionConstraint value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint) { + this.apiVersionConstraint = apiVersionConstraint; + return this; + } + + /** + * Get the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @return the restore value. + */ + public Boolean restore() { + return this.restore; + } + + /** + * Set the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @param restore the restore value to set. + * @return the ApiManagementServiceBaseProperties object itself. + */ + public ApiManagementServiceBaseProperties withRestore(Boolean restore) { + this.restore = restore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostnameConfigurations() != null) { + hostnameConfigurations().forEach(e -> e.validate()); + } + if (virtualNetworkConfiguration() != null) { + virtualNetworkConfiguration().validate(); + } + if (additionalLocations() != null) { + additionalLocations().forEach(e -> e.validate()); + } + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (apiVersionConstraint() != null) { + apiVersionConstraint().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceCheckNameAvailabilityParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..c5d22c4060e7f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceCheckNameAvailabilityParameters.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the CheckNameAvailability operation. */ +@Fluent +public final class ApiManagementServiceCheckNameAvailabilityParameters { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ApiManagementServiceCheckNameAvailabilityParameters.class); + + /* + * The name to check for availability. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The name to check for availability. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name to check for availability. + * + * @param name the name value to set. + * @return the ApiManagementServiceCheckNameAvailabilityParameters object itself. + */ + public ApiManagementServiceCheckNameAvailabilityParameters withName(String name) { + this.name = name; + 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 ApiManagementServiceCheckNameAvailabilityParameters")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetDomainOwnershipIdentifierResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetDomainOwnershipIdentifierResult.java new file mode 100644 index 0000000000000..48f57eae819de --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetDomainOwnershipIdentifierResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetDomainOwnershipIdentifierResultInner; + +/** An immutable client-side representation of ApiManagementServiceGetDomainOwnershipIdentifierResult. */ +public interface ApiManagementServiceGetDomainOwnershipIdentifierResult { + /** + * Gets the domainOwnershipIdentifier property: The domain ownership identifier value. + * + * @return the domainOwnershipIdentifier value. + */ + String domainOwnershipIdentifier(); + + /** + * Gets the inner + * com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetDomainOwnershipIdentifierResultInner + * object. + * + * @return the inner object. + */ + ApiManagementServiceGetDomainOwnershipIdentifierResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetSsoTokenResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetSsoTokenResult.java new file mode 100644 index 0000000000000..6502d76f74bc9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceGetSsoTokenResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetSsoTokenResultInner; + +/** An immutable client-side representation of ApiManagementServiceGetSsoTokenResult. */ +public interface ApiManagementServiceGetSsoTokenResult { + /** + * Gets the redirectUri property: Redirect URL to the Publisher Portal containing the SSO token. + * + * @return the redirectUri value. + */ + String redirectUri(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceGetSsoTokenResultInner + * object. + * + * @return the inner object. + */ + ApiManagementServiceGetSsoTokenResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceIdentity.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceIdentity.java new file mode 100644 index 0000000000000..e1f70a6172bef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceIdentity.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Identity properties of the Api Management service resource. */ +@Fluent +public class ApiManagementServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceIdentity.class); + + /* + * The type of identity used for the resource. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. The type 'None' will remove any identities + * from the service. + */ + @JsonProperty(value = "type", required = true) + private ApimIdentityType type; + + /* + * The principal id of the identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client tenant id of the identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * The list of user identities associated with the resource. The user + * identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the service. + * + * @return the type value. + */ + public ApimIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove + * any identities from the service. + * + * @param type the type value to set. + * @return the ApiManagementServiceIdentity object itself. + */ + public ApiManagementServiceIdentity withType(ApimIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The principal id of the identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The client tenant id of the identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ApiManagementServiceIdentity object itself. + */ + public ApiManagementServiceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model ApiManagementServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceListResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceListResult.java new file mode 100644 index 0000000000000..30818988aa2e1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceListResult.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the List API Management services operation. */ +@Fluent +public final class ApiManagementServiceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceListResult.class); + + /* + * Result of the List API Management services operation. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to the next set of results. Not empty if Value contains incomplete + * list of API Management services. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Result of the List API Management services operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Result of the List API Management services operation. + * + * @param value the value value to set. + * @return the ApiManagementServiceListResult object itself. + */ + public ApiManagementServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of API + * Management services. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of API + * Management services. + * + * @param nextLink the nextLink value to set. + * @return the ApiManagementServiceListResult object itself. + */ + public ApiManagementServiceListResult 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) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ApiManagementServiceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceNameAvailabilityResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceNameAvailabilityResult.java new file mode 100644 index 0000000000000..cecf10c8c02eb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceNameAvailabilityResult.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceNameAvailabilityResultInner; + +/** An immutable client-side representation of ApiManagementServiceNameAvailabilityResult. */ +public interface ApiManagementServiceNameAvailabilityResult { + /** + * Gets the nameAvailable property: True if the name is available and can be used to create a new API Management + * service; otherwise false. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the message property: If reason == invalid, provide the user with the reason why the given name is invalid, + * and provide the resource naming requirements so that the user can select a valid name. If reason == + * AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name. + * + * @return the message value. + */ + String message(); + + /** + * Gets the reason property: Invalid indicates the name provided does not match the resource provider’s naming + * requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in + * use and is therefore unavailable. + * + * @return the reason value. + */ + NameAvailabilityReason reason(); + + /** + * Gets the inner + * com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceNameAvailabilityResultInner object. + * + * @return the inner object. + */ + ApiManagementServiceNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceProperties.java new file mode 100644 index 0000000000000..2e40660f201e4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceProperties.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.apimanagement.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; +import java.util.Map; + +/** Properties of an API Management service resource description. */ +@Fluent +public final class ApiManagementServiceProperties extends ApiManagementServiceBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceProperties.class); + + /* + * Publisher email. + */ + @JsonProperty(value = "publisherEmail", required = true) + private String publisherEmail; + + /* + * Publisher name. + */ + @JsonProperty(value = "publisherName", required = true) + private String publisherName; + + /** + * Get the publisherEmail property: Publisher email. + * + * @return the publisherEmail value. + */ + public String publisherEmail() { + return this.publisherEmail; + } + + /** + * Set the publisherEmail property: Publisher email. + * + * @param publisherEmail the publisherEmail value to set. + * @return the ApiManagementServiceProperties object itself. + */ + public ApiManagementServiceProperties withPublisherEmail(String publisherEmail) { + this.publisherEmail = publisherEmail; + return this; + } + + /** + * Get the publisherName property: Publisher name. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Set the publisherName property: Publisher name. + * + * @param publisherName the publisherName value to set. + * @return the ApiManagementServiceProperties object itself. + */ + public ApiManagementServiceProperties withPublisherName(String publisherName) { + this.publisherName = publisherName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withNotificationSenderEmail(String notificationSenderEmail) { + super.withNotificationSenderEmail(notificationSenderEmail); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withHostnameConfigurations( + List hostnameConfigurations) { + super.withHostnameConfigurations(hostnameConfigurations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withVirtualNetworkConfiguration( + VirtualNetworkConfiguration virtualNetworkConfiguration) { + super.withVirtualNetworkConfiguration(virtualNetworkConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withAdditionalLocations(List additionalLocations) { + super.withAdditionalLocations(additionalLocations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withCustomProperties(Map customProperties) { + super.withCustomProperties(customProperties); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withCertificates(List certificates) { + super.withCertificates(certificates); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withEnableClientCertificate(Boolean enableClientCertificate) { + super.withEnableClientCertificate(enableClientCertificate); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withDisableGateway(Boolean disableGateway) { + super.withDisableGateway(disableGateway); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withVirtualNetworkType(VirtualNetworkType virtualNetworkType) { + super.withVirtualNetworkType(virtualNetworkType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint) { + super.withApiVersionConstraint(apiVersionConstraint); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceProperties withRestore(Boolean restore) { + super.withRestore(restore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (publisherEmail() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisherEmail in model ApiManagementServiceProperties")); + } + if (publisherName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publisherName in model ApiManagementServiceProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceResource.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceResource.java new file mode 100644 index 0000000000000..ec5454067a859 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceResource.java @@ -0,0 +1,992 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementServiceResourceInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApiManagementServiceResource. */ +public interface ApiManagementServiceResource { + /** + * 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 tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: SKU properties of the API Management service. + * + * @return the sku value. + */ + ApiManagementServiceSkuProperties sku(); + + /** + * Gets the identity property: Managed service identity of the Api Management service. + * + * @return the identity value. + */ + ApiManagementServiceIdentity identity(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the etag property: ETag of the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the zones property: A list of availability zones denoting where the resource needs to come from. + * + * @return the zones value. + */ + List zones(); + + /** + * Gets the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @return the notificationSenderEmail value. + */ + String notificationSenderEmail(); + + /** + * Gets the provisioningState property: The current provisioning state of the API Management service which can be + * one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the targetProvisioningState property: The provisioning state of the API Management service, which is + * targeted by the long running operation started on the service. + * + * @return the targetProvisioningState value. + */ + String targetProvisioningState(); + + /** + * Gets the createdAtUtc property: Creation UTC date of the API Management service.The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the createdAtUtc value. + */ + OffsetDateTime createdAtUtc(); + + /** + * Gets the gatewayUrl property: Gateway URL of the API Management service. + * + * @return the gatewayUrl value. + */ + String gatewayUrl(); + + /** + * Gets the gatewayRegionalUrl property: Gateway URL of the API Management service in the Default Region. + * + * @return the gatewayRegionalUrl value. + */ + String gatewayRegionalUrl(); + + /** + * Gets the portalUrl property: Publisher portal endpoint Url of the API Management service. + * + * @return the portalUrl value. + */ + String portalUrl(); + + /** + * Gets the managementApiUrl property: Management API endpoint URL of the API Management service. + * + * @return the managementApiUrl value. + */ + String managementApiUrl(); + + /** + * Gets the scmUrl property: SCM endpoint URL of the API Management service. + * + * @return the scmUrl value. + */ + String scmUrl(); + + /** + * Gets the developerPortalUrl property: DEveloper Portal endpoint URL of the API Management service. + * + * @return the developerPortalUrl value. + */ + String developerPortalUrl(); + + /** + * Gets the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @return the hostnameConfigurations value. + */ + List hostnameConfigurations(); + + /** + * Gets the publicIpAddresses property: Public Static Load Balanced IP addresses of the API Management service in + * Primary region. Available only for Basic, Standard, Premium and Isolated SKU. + * + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * Gets the privateIpAddresses property: Private Static Load Balanced IP addresses of the API Management service in + * Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and + * Isolated SKU. + * + * @return the privateIpAddresses value. + */ + List privateIpAddresses(); + + /** + * Gets the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @return the virtualNetworkConfiguration value. + */ + VirtualNetworkConfiguration virtualNetworkConfiguration(); + + /** + * Gets the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @return the additionalLocations value. + */ + List additionalLocations(); + + /** + * Gets the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @return the customProperties value. + */ + Map customProperties(); + + /** + * Gets the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @return the certificates value. + */ + List certificates(); + + /** + * Gets the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @return the enableClientCertificate value. + */ + Boolean enableClientCertificate(); + + /** + * Gets the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @return the disableGateway value. + */ + Boolean disableGateway(); + + /** + * Gets the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @return the virtualNetworkType value. + */ + VirtualNetworkType virtualNetworkType(); + + /** + * Gets the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @return the apiVersionConstraint value. + */ + ApiVersionConstraint apiVersionConstraint(); + + /** + * Gets the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @return the restore value. + */ + Boolean restore(); + + /** + * Gets the publisherEmail property: Publisher email. + * + * @return the publisherEmail value. + */ + String publisherEmail(); + + /** + * Gets the publisherName property: Publisher name. + * + * @return the publisherName value. + */ + String publisherName(); + + /** + * 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.apimanagement.fluent.models.ApiManagementServiceResourceInner object. + * + * @return the inner object. + */ + ApiManagementServiceResourceInner innerModel(); + + /** The entirety of the ApiManagementServiceResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithPublisherEmail, + DefinitionStages.WithPublisherName, + DefinitionStages.WithCreate { + } + /** The ApiManagementServiceResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApiManagementServiceResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ApiManagementServiceResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Resource location. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU properties of the API Management service.. + * + * @param sku SKU properties of the API Management service. + * @return the next definition stage. + */ + WithPublisherEmail withSku(ApiManagementServiceSkuProperties sku); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify publisherEmail. */ + interface WithPublisherEmail { + /** + * Specifies the publisherEmail property: Publisher email.. + * + * @param publisherEmail Publisher email. + * @return the next definition stage. + */ + WithPublisherName withPublisherEmail(String publisherEmail); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify publisherName. */ + interface WithPublisherName { + /** + * Specifies the publisherName property: Publisher name.. + * + * @param publisherName Publisher name. + * @return the next definition stage. + */ + WithCreate withPublisherName(String publisherName); + } + /** + * The stage of the ApiManagementServiceResource definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithZones, + DefinitionStages.WithNotificationSenderEmail, + DefinitionStages.WithHostnameConfigurations, + DefinitionStages.WithVirtualNetworkConfiguration, + DefinitionStages.WithAdditionalLocations, + DefinitionStages.WithCustomProperties, + DefinitionStages.WithCertificates, + DefinitionStages.WithEnableClientCertificate, + DefinitionStages.WithDisableGateway, + DefinitionStages.WithVirtualNetworkType, + DefinitionStages.WithApiVersionConstraint, + DefinitionStages.WithRestore { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiManagementServiceResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiManagementServiceResource create(Context context); + } + /** The stage of the ApiManagementServiceResource 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 ApiManagementServiceResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity of the Api Management service.. + * + * @param identity Managed service identity of the Api Management service. + * @return the next definition stage. + */ + WithCreate withIdentity(ApiManagementServiceIdentity identity); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify zones. */ + interface WithZones { + /** + * Specifies the zones property: A list of availability zones denoting where the resource needs to come + * from.. + * + * @param zones A list of availability zones denoting where the resource needs to come from. + * @return the next definition stage. + */ + WithCreate withZones(List zones); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify notificationSenderEmail. */ + interface WithNotificationSenderEmail { + /** + * Specifies the notificationSenderEmail property: Email address from which the notification will be sent.. + * + * @param notificationSenderEmail Email address from which the notification will be sent. + * @return the next definition stage. + */ + WithCreate withNotificationSenderEmail(String notificationSenderEmail); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify hostnameConfigurations. */ + interface WithHostnameConfigurations { + /** + * Specifies the hostnameConfigurations property: Custom hostname configuration of the API Management + * service.. + * + * @param hostnameConfigurations Custom hostname configuration of the API Management service. + * @return the next definition stage. + */ + WithCreate withHostnameConfigurations(List hostnameConfigurations); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify virtualNetworkConfiguration. */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies the virtualNetworkConfiguration property: Virtual network configuration of the API Management + * service.. + * + * @param virtualNetworkConfiguration Virtual network configuration of the API Management service. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify additionalLocations. */ + interface WithAdditionalLocations { + /** + * Specifies the additionalLocations property: Additional datacenter locations of the API Management + * service.. + * + * @param additionalLocations Additional datacenter locations of the API Management service. + * @return the next definition stage. + */ + WithCreate withAdditionalLocations(List additionalLocations); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify customProperties. */ + interface WithCustomProperties { + /** + * Specifies the customProperties property: Custom properties of the API Management + * service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + * will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be + * used to disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable + * just TLS 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable + * TLS 1.0 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 + * protocol on an API Management service.</br>Not specifying any of these properties on PATCH + * operation will reset omitted properties' values to their defaults. For all the settings except Http2 the + * default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. + * Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by + * using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, + * TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + * TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be disabled since they are required by + * Azure CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @param customProperties Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just + * TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + * can be used to disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to + * disable just TLS 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to + * disable TLS 1.0 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 + * protocol on an API Management service.</br>Not specifying any of these properties on PATCH + * operation will reset omitted properties' values to their defaults. For all the settings except Http2 + * the default value is `True` if the service was created on or before April 1st 2018 and `False` + * otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next + * ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + * TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, + * TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be disabled since they are required by + * Azure CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * @return the next definition stage. + */ + WithCreate withCustomProperties(Map customProperties); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify certificates. */ + interface WithCertificates { + /** + * Specifies the certificates property: List of Certificates that need to be installed in the API Management + * service. Max supported certificates that can be installed is 10.. + * + * @param certificates List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * @return the next definition stage. + */ + WithCreate withCertificates(List certificates); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify enableClientCertificate. */ + interface WithEnableClientCertificate { + /** + * Specifies the enableClientCertificate property: Property only meant to be used for Consumption SKU + * Service. This enforces a client certificate to be presented on each request to the gateway. This also + * enables the ability to authenticate the certificate in the policy on the gateway.. + * + * @param enableClientCertificate Property only meant to be used for Consumption SKU Service. This enforces + * a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * @return the next definition stage. + */ + WithCreate withEnableClientCertificate(Boolean enableClientCertificate); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify disableGateway. */ + interface WithDisableGateway { + /** + * Specifies the disableGateway property: Property only valid for an Api Management service deployed in + * multiple locations. This can be used to disable the gateway in master region.. + * + * @param disableGateway Property only valid for an Api Management service deployed in multiple locations. + * This can be used to disable the gateway in master region. + * @return the next definition stage. + */ + WithCreate withDisableGateway(Boolean disableGateway); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify virtualNetworkType. */ + interface WithVirtualNetworkType { + /** + * Specifies the virtualNetworkType property: The type of VPN in which API Management service needs to be + * configured in. None (Default Value) means the API Management service is not part of any Virtual Network, + * External means the API Management deployment is set up inside a Virtual Network having an Internet Facing + * Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an + * Intranet Facing Endpoint only.. + * + * @param virtualNetworkType The type of VPN in which API Management service needs to be configured in. None + * (Default Value) means the API Management service is not part of any Virtual Network, External means + * the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, + * and Internal means that API Management deployment is setup inside a Virtual Network having an + * Intranet Facing Endpoint only. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkType(VirtualNetworkType virtualNetworkType); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify apiVersionConstraint. */ + interface WithApiVersionConstraint { + /** + * Specifies the apiVersionConstraint property: Control Plane Apis version constraint for the API Management + * service.. + * + * @param apiVersionConstraint Control Plane Apis version constraint for the API Management service. + * @return the next definition stage. + */ + WithCreate withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint); + } + /** The stage of the ApiManagementServiceResource definition allowing to specify restore. */ + interface WithRestore { + /** + * Specifies the restore property: Undelete Api Management Service if it was previously soft-deleted. If + * this flag is specified and set to True all other properties will be ignored.. + * + * @param restore Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * @return the next definition stage. + */ + WithCreate withRestore(Boolean restore); + } + } + /** + * Begins update for the ApiManagementServiceResource resource. + * + * @return the stage of resource update. + */ + ApiManagementServiceResource.Update update(); + + /** The template for ApiManagementServiceResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithNotificationSenderEmail, + UpdateStages.WithHostnameConfigurations, + UpdateStages.WithVirtualNetworkConfiguration, + UpdateStages.WithAdditionalLocations, + UpdateStages.WithCustomProperties, + UpdateStages.WithCertificates, + UpdateStages.WithEnableClientCertificate, + UpdateStages.WithDisableGateway, + UpdateStages.WithVirtualNetworkType, + UpdateStages.WithApiVersionConstraint, + UpdateStages.WithRestore, + UpdateStages.WithPublisherEmail, + UpdateStages.WithPublisherName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiManagementServiceResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiManagementServiceResource apply(Context context); + } + /** The ApiManagementServiceResource update stages. */ + interface UpdateStages { + /** The stage of the ApiManagementServiceResource 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 ApiManagementServiceResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU properties of the API Management service.. + * + * @param sku SKU properties of the API Management service. + * @return the next definition stage. + */ + Update withSku(ApiManagementServiceSkuProperties sku); + } + /** The stage of the ApiManagementServiceResource update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity of the Api Management service.. + * + * @param identity Managed service identity of the Api Management service. + * @return the next definition stage. + */ + Update withIdentity(ApiManagementServiceIdentity identity); + } + /** The stage of the ApiManagementServiceResource update allowing to specify notificationSenderEmail. */ + interface WithNotificationSenderEmail { + /** + * Specifies the notificationSenderEmail property: Email address from which the notification will be sent.. + * + * @param notificationSenderEmail Email address from which the notification will be sent. + * @return the next definition stage. + */ + Update withNotificationSenderEmail(String notificationSenderEmail); + } + /** The stage of the ApiManagementServiceResource update allowing to specify hostnameConfigurations. */ + interface WithHostnameConfigurations { + /** + * Specifies the hostnameConfigurations property: Custom hostname configuration of the API Management + * service.. + * + * @param hostnameConfigurations Custom hostname configuration of the API Management service. + * @return the next definition stage. + */ + Update withHostnameConfigurations(List hostnameConfigurations); + } + /** The stage of the ApiManagementServiceResource update allowing to specify virtualNetworkConfiguration. */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies the virtualNetworkConfiguration property: Virtual network configuration of the API Management + * service.. + * + * @param virtualNetworkConfiguration Virtual network configuration of the API Management service. + * @return the next definition stage. + */ + Update withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + /** The stage of the ApiManagementServiceResource update allowing to specify additionalLocations. */ + interface WithAdditionalLocations { + /** + * Specifies the additionalLocations property: Additional datacenter locations of the API Management + * service.. + * + * @param additionalLocations Additional datacenter locations of the API Management service. + * @return the next definition stage. + */ + Update withAdditionalLocations(List additionalLocations); + } + /** The stage of the ApiManagementServiceResource update allowing to specify customProperties. */ + interface WithCustomProperties { + /** + * Specifies the customProperties property: Custom properties of the API Management + * service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + * will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be + * used to disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable + * just TLS 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable + * TLS 1.0 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 + * protocol on an API Management service.</br>Not specifying any of these properties on PATCH + * operation will reset omitted properties' values to their defaults. For all the settings except Http2 the + * default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. + * Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by + * using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, + * TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + * TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be disabled since they are required by + * Azure CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @param customProperties Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just + * TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + * can be used to disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to + * disable just TLS 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to + * disable TLS 1.0 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 + * protocol on an API Management service.</br>Not specifying any of these properties on PATCH + * operation will reset omitted properties' values to their defaults. For all the settings except Http2 + * the default value is `True` if the service was created on or before April 1st 2018 and `False` + * otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next + * ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + * TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, + * TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be disabled since they are required by + * Azure CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * @return the next definition stage. + */ + Update withCustomProperties(Map customProperties); + } + /** The stage of the ApiManagementServiceResource update allowing to specify certificates. */ + interface WithCertificates { + /** + * Specifies the certificates property: List of Certificates that need to be installed in the API Management + * service. Max supported certificates that can be installed is 10.. + * + * @param certificates List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * @return the next definition stage. + */ + Update withCertificates(List certificates); + } + /** The stage of the ApiManagementServiceResource update allowing to specify enableClientCertificate. */ + interface WithEnableClientCertificate { + /** + * Specifies the enableClientCertificate property: Property only meant to be used for Consumption SKU + * Service. This enforces a client certificate to be presented on each request to the gateway. This also + * enables the ability to authenticate the certificate in the policy on the gateway.. + * + * @param enableClientCertificate Property only meant to be used for Consumption SKU Service. This enforces + * a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * @return the next definition stage. + */ + Update withEnableClientCertificate(Boolean enableClientCertificate); + } + /** The stage of the ApiManagementServiceResource update allowing to specify disableGateway. */ + interface WithDisableGateway { + /** + * Specifies the disableGateway property: Property only valid for an Api Management service deployed in + * multiple locations. This can be used to disable the gateway in master region.. + * + * @param disableGateway Property only valid for an Api Management service deployed in multiple locations. + * This can be used to disable the gateway in master region. + * @return the next definition stage. + */ + Update withDisableGateway(Boolean disableGateway); + } + /** The stage of the ApiManagementServiceResource update allowing to specify virtualNetworkType. */ + interface WithVirtualNetworkType { + /** + * Specifies the virtualNetworkType property: The type of VPN in which API Management service needs to be + * configured in. None (Default Value) means the API Management service is not part of any Virtual Network, + * External means the API Management deployment is set up inside a Virtual Network having an Internet Facing + * Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an + * Intranet Facing Endpoint only.. + * + * @param virtualNetworkType The type of VPN in which API Management service needs to be configured in. None + * (Default Value) means the API Management service is not part of any Virtual Network, External means + * the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, + * and Internal means that API Management deployment is setup inside a Virtual Network having an + * Intranet Facing Endpoint only. + * @return the next definition stage. + */ + Update withVirtualNetworkType(VirtualNetworkType virtualNetworkType); + } + /** The stage of the ApiManagementServiceResource update allowing to specify apiVersionConstraint. */ + interface WithApiVersionConstraint { + /** + * Specifies the apiVersionConstraint property: Control Plane Apis version constraint for the API Management + * service.. + * + * @param apiVersionConstraint Control Plane Apis version constraint for the API Management service. + * @return the next definition stage. + */ + Update withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint); + } + /** The stage of the ApiManagementServiceResource update allowing to specify restore. */ + interface WithRestore { + /** + * Specifies the restore property: Undelete Api Management Service if it was previously soft-deleted. If + * this flag is specified and set to True all other properties will be ignored.. + * + * @param restore Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * @return the next definition stage. + */ + Update withRestore(Boolean restore); + } + /** The stage of the ApiManagementServiceResource update allowing to specify publisherEmail. */ + interface WithPublisherEmail { + /** + * Specifies the publisherEmail property: Publisher email.. + * + * @param publisherEmail Publisher email. + * @return the next definition stage. + */ + Update withPublisherEmail(String publisherEmail); + } + /** The stage of the ApiManagementServiceResource update allowing to specify publisherName. */ + interface WithPublisherName { + /** + * Specifies the publisherName property: Publisher name.. + * + * @param publisherName Publisher name. + * @return the next definition stage. + */ + Update withPublisherName(String publisherName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiManagementServiceResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiManagementServiceResource refresh(Context context); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource backup(ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource backup(ApiManagementServiceBackupRestoreParameters parameters, Context context); + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + ApiManagementServiceGetSsoTokenResult getSsoToken(); + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + Response getSsoTokenWithResponse(Context context); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource applyNetworkConfigurationUpdates( + ApiManagementServiceApplyNetworkConfigurationParameters parameters); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource applyNetworkConfigurationUpdates(); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource applyNetworkConfigurationUpdates( + ApiManagementServiceApplyNetworkConfigurationParameters parameters, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkuProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkuProperties.java new file mode 100644 index 0000000000000..c9a5b1014fed9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkuProperties.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.apimanagement.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; + +/** API Management service resource SKU properties. */ +@Fluent +public final class ApiManagementServiceSkuProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceSkuProperties.class); + + /* + * Name of the Sku. + */ + @JsonProperty(value = "name", required = true) + private SkuType name; + + /* + * Capacity of the SKU (number of deployed units of the SKU). For + * Consumption SKU capacity must be specified as 0. + */ + @JsonProperty(value = "capacity", required = true) + private int capacity; + + /** + * Get the name property: Name of the Sku. + * + * @return the name value. + */ + public SkuType name() { + return this.name; + } + + /** + * Set the name property: Name of the Sku. + * + * @param name the name value to set. + * @return the ApiManagementServiceSkuProperties object itself. + */ + public ApiManagementServiceSkuProperties withName(SkuType name) { + this.name = name; + return this; + } + + /** + * Get the capacity property: Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU + * capacity must be specified as 0. + * + * @return the capacity value. + */ + public int capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU + * capacity must be specified as 0. + * + * @param capacity the capacity value to set. + * @return the ApiManagementServiceSkuProperties object itself. + */ + public ApiManagementServiceSkuProperties withCapacity(int capacity) { + this.capacity = capacity; + 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 ApiManagementServiceSkuProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkus.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkus.java new file mode 100644 index 0000000000000..72c5331025018 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceSkus.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApiManagementServiceSkus. */ +public interface ApiManagementServiceSkus { + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + PagedIterable listAvailableServiceSkus(String resourceGroupName, String serviceName); + + /** + * Gets all available SKU for a given API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available SKU for a given API Management service. + */ + PagedIterable listAvailableServiceSkus( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateParameters.java new file mode 100644 index 0000000000000..8af8785c62887 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateParameters.java @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Parameter supplied to Update Api Management Service. */ +@JsonFlatten +@Fluent +public class ApiManagementServiceUpdateParameters extends ApimResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceUpdateParameters.class); + + /* + * SKU properties of the API Management service. + */ + @JsonProperty(value = "sku") + private ApiManagementServiceSkuProperties sku; + + /* + * Managed service identity of the Api Management service. + */ + @JsonProperty(value = "identity") + private ApiManagementServiceIdentity identity; + + /* + * ETag of the resource. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * Email address from which the notification will be sent. + */ + @JsonProperty(value = "properties.notificationSenderEmail") + private String notificationSenderEmail; + + /* + * The current provisioning state of the API Management service which can + * be one of the following: + * Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The provisioning state of the API Management service, which is targeted + * by the long running operation started on the service. + */ + @JsonProperty(value = "properties.targetProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String targetProvisioningState; + + /* + * Creation UTC date of the API Management service.The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + */ + @JsonProperty(value = "properties.createdAtUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdAtUtc; + + /* + * Gateway URL of the API Management service. + */ + @JsonProperty(value = "properties.gatewayUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayUrl; + + /* + * Gateway URL of the API Management service in the Default Region. + */ + @JsonProperty(value = "properties.gatewayRegionalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayRegionalUrl; + + /* + * Publisher portal endpoint Url of the API Management service. + */ + @JsonProperty(value = "properties.portalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String portalUrl; + + /* + * Management API endpoint URL of the API Management service. + */ + @JsonProperty(value = "properties.managementApiUrl", access = JsonProperty.Access.WRITE_ONLY) + private String managementApiUrl; + + /* + * SCM endpoint URL of the API Management service. + */ + @JsonProperty(value = "properties.scmUrl", access = JsonProperty.Access.WRITE_ONLY) + private String scmUrl; + + /* + * DEveloper Portal endpoint URL of the API Management service. + */ + @JsonProperty(value = "properties.developerPortalUrl", access = JsonProperty.Access.WRITE_ONLY) + private String developerPortalUrl; + + /* + * Custom hostname configuration of the API Management service. + */ + @JsonProperty(value = "properties.hostnameConfigurations") + private List hostnameConfigurations; + + /* + * Public Static Load Balanced IP addresses of the API Management service + * in Primary region. Available only for Basic, Standard, Premium and + * Isolated SKU. + */ + @JsonProperty(value = "properties.publicIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List publicIpAddresses; + + /* + * Private Static Load Balanced IP addresses of the API Management service + * in Primary region which is deployed in an Internal Virtual Network. + * Available only for Basic, Standard, Premium and Isolated SKU. + */ + @JsonProperty(value = "properties.privateIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List privateIpAddresses; + + /* + * Virtual network configuration of the API Management service. + */ + @JsonProperty(value = "properties.virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /* + * Additional datacenter locations of the API Management service. + */ + @JsonProperty(value = "properties.additionalLocations") + private List additionalLocations; + + /* + * Custom properties of the API Management service.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` + * will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, + * 1.1 and 1.2).
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` + * can be used to disable just TLS 1.1.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` + * can be used to disable TLS 1.0 on an API Management service.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` + * can be used to disable just TLS 1.1 for communications with + * backends.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` + * can be used to disable TLS 1.0 for communications with + * backends.
Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` + * can be used to enable HTTP2 protocol on an API Management + * service.
Not specifying any of these properties on PATCH operation + * will reset omitted properties' values to their defaults. For all the + * settings except Http2 the default value is `True` if the service was + * created on or before April 1st 2018 and `False` otherwise. Http2 + * setting's default value is `False`.

You can disable any of next + * ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + * TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, + * TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. + * The default value is `true` for them. Note: next ciphers can't be + * disabled since they are required by Azure CloudService internal + * components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 + */ + @JsonProperty(value = "properties.customProperties") + private Map customProperties; + + /* + * List of Certificates that need to be installed in the API Management + * service. Max supported certificates that can be installed is 10. + */ + @JsonProperty(value = "properties.certificates") + private List certificates; + + /* + * Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the + * gateway. This also enables the ability to authenticate the certificate + * in the policy on the gateway. + */ + @JsonProperty(value = "properties.enableClientCertificate") + private Boolean enableClientCertificate; + + /* + * Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + */ + @JsonProperty(value = "properties.disableGateway") + private Boolean disableGateway; + + /* + * The type of VPN in which API Management service needs to be configured + * in. None (Default Value) means the API Management service is not part of + * any Virtual Network, External means the API Management deployment is set + * up inside a Virtual Network having an Internet Facing Endpoint, and + * Internal means that API Management deployment is setup inside a Virtual + * Network having an Intranet Facing Endpoint only. + */ + @JsonProperty(value = "properties.virtualNetworkType") + private VirtualNetworkType virtualNetworkType; + + /* + * Control Plane Apis version constraint for the API Management service. + */ + @JsonProperty(value = "properties.apiVersionConstraint") + private ApiVersionConstraint apiVersionConstraint; + + /* + * Undelete Api Management Service if it was previously soft-deleted. If + * this flag is specified and set to True all other properties will be + * ignored. + */ + @JsonProperty(value = "properties.restore") + private Boolean restore; + + /* + * Publisher email. + */ + @JsonProperty(value = "properties.publisherEmail") + private String publisherEmail; + + /* + * Publisher name. + */ + @JsonProperty(value = "properties.publisherName") + private String publisherName; + + /** + * Get the sku property: SKU properties of the API Management service. + * + * @return the sku value. + */ + public ApiManagementServiceSkuProperties sku() { + return this.sku; + } + + /** + * Set the sku property: SKU properties of the API Management service. + * + * @param sku the sku value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withSku(ApiManagementServiceSkuProperties sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Managed service identity of the Api Management service. + * + * @return the identity value. + */ + public ApiManagementServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity of the Api Management service. + * + * @param identity the identity value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withIdentity(ApiManagementServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the etag property: ETag of the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @return the notificationSenderEmail value. + */ + public String notificationSenderEmail() { + return this.notificationSenderEmail; + } + + /** + * Set the notificationSenderEmail property: Email address from which the notification will be sent. + * + * @param notificationSenderEmail the notificationSenderEmail value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withNotificationSenderEmail(String notificationSenderEmail) { + this.notificationSenderEmail = notificationSenderEmail; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state of the API Management service which can be one + * of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the targetProvisioningState property: The provisioning state of the API Management service, which is targeted + * by the long running operation started on the service. + * + * @return the targetProvisioningState value. + */ + public String targetProvisioningState() { + return this.targetProvisioningState; + } + + /** + * Get the createdAtUtc property: Creation UTC date of the API Management service.The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the createdAtUtc value. + */ + public OffsetDateTime createdAtUtc() { + return this.createdAtUtc; + } + + /** + * Get the gatewayUrl property: Gateway URL of the API Management service. + * + * @return the gatewayUrl value. + */ + public String gatewayUrl() { + return this.gatewayUrl; + } + + /** + * Get the gatewayRegionalUrl property: Gateway URL of the API Management service in the Default Region. + * + * @return the gatewayRegionalUrl value. + */ + public String gatewayRegionalUrl() { + return this.gatewayRegionalUrl; + } + + /** + * Get the portalUrl property: Publisher portal endpoint Url of the API Management service. + * + * @return the portalUrl value. + */ + public String portalUrl() { + return this.portalUrl; + } + + /** + * Get the managementApiUrl property: Management API endpoint URL of the API Management service. + * + * @return the managementApiUrl value. + */ + public String managementApiUrl() { + return this.managementApiUrl; + } + + /** + * Get the scmUrl property: SCM endpoint URL of the API Management service. + * + * @return the scmUrl value. + */ + public String scmUrl() { + return this.scmUrl; + } + + /** + * Get the developerPortalUrl property: DEveloper Portal endpoint URL of the API Management service. + * + * @return the developerPortalUrl value. + */ + public String developerPortalUrl() { + return this.developerPortalUrl; + } + + /** + * Get the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @return the hostnameConfigurations value. + */ + public List hostnameConfigurations() { + return this.hostnameConfigurations; + } + + /** + * Set the hostnameConfigurations property: Custom hostname configuration of the API Management service. + * + * @param hostnameConfigurations the hostnameConfigurations value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withHostnameConfigurations( + List hostnameConfigurations) { + this.hostnameConfigurations = hostnameConfigurations; + return this; + } + + /** + * Get the publicIpAddresses property: Public Static Load Balanced IP addresses of the API Management service in + * Primary region. Available only for Basic, Standard, Premium and Isolated SKU. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Get the privateIpAddresses property: Private Static Load Balanced IP addresses of the API Management service in + * Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and + * Isolated SKU. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Get the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @return the virtualNetworkConfiguration value. + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set the virtualNetworkConfiguration property: Virtual network configuration of the API Management service. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withVirtualNetworkConfiguration( + VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @return the additionalLocations value. + */ + public List additionalLocations() { + return this.additionalLocations; + } + + /** + * Set the additionalLocations property: Additional datacenter locations of the API Management service. + * + * @param additionalLocations the additionalLocations value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withAdditionalLocations(List additionalLocations) { + this.additionalLocations = additionalLocations; + return this; + } + + /** + * Get the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @return the customProperties value. + */ + public Map customProperties() { + return this.customProperties; + } + + /** + * Set the customProperties property: Custom properties of the API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher + * TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS + * 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to + * disable TLS 1.0 on an API Management service.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS + * 1.1 for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 + * for communications with backends.</br>Setting + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an + * API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted + * properties' values to their defaults. For all the settings except Http2 the default value is `True` if the + * service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is + * `False`.</br></br>You can disable any of next ciphers by using settings + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + * TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, + * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The + * default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure + * CloudService internal components: + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + * + * @param customProperties the customProperties value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withCustomProperties(Map customProperties) { + this.customProperties = customProperties; + return this; + } + + /** + * Get the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: List of Certificates that need to be installed in the API Management service. Max + * supported certificates that can be installed is 10. + * + * @param certificates the certificates value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @return the enableClientCertificate value. + */ + public Boolean enableClientCertificate() { + return this.enableClientCertificate; + } + + /** + * Set the enableClientCertificate property: Property only meant to be used for Consumption SKU Service. This + * enforces a client certificate to be presented on each request to the gateway. This also enables the ability to + * authenticate the certificate in the policy on the gateway. + * + * @param enableClientCertificate the enableClientCertificate value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withEnableClientCertificate(Boolean enableClientCertificate) { + this.enableClientCertificate = enableClientCertificate; + return this; + } + + /** + * Get the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @return the disableGateway value. + */ + public Boolean disableGateway() { + return this.disableGateway; + } + + /** + * Set the disableGateway property: Property only valid for an Api Management service deployed in multiple + * locations. This can be used to disable the gateway in master region. + * + * @param disableGateway the disableGateway value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withDisableGateway(Boolean disableGateway) { + this.disableGateway = disableGateway; + return this; + } + + /** + * Get the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @return the virtualNetworkType value. + */ + public VirtualNetworkType virtualNetworkType() { + return this.virtualNetworkType; + } + + /** + * Set the virtualNetworkType property: The type of VPN in which API Management service needs to be configured in. + * None (Default Value) means the API Management service is not part of any Virtual Network, External means the API + * Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means + * that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. + * + * @param virtualNetworkType the virtualNetworkType value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withVirtualNetworkType(VirtualNetworkType virtualNetworkType) { + this.virtualNetworkType = virtualNetworkType; + return this; + } + + /** + * Get the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @return the apiVersionConstraint value. + */ + public ApiVersionConstraint apiVersionConstraint() { + return this.apiVersionConstraint; + } + + /** + * Set the apiVersionConstraint property: Control Plane Apis version constraint for the API Management service. + * + * @param apiVersionConstraint the apiVersionConstraint value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint) { + this.apiVersionConstraint = apiVersionConstraint; + return this; + } + + /** + * Get the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @return the restore value. + */ + public Boolean restore() { + return this.restore; + } + + /** + * Set the restore property: Undelete Api Management Service if it was previously soft-deleted. If this flag is + * specified and set to True all other properties will be ignored. + * + * @param restore the restore value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withRestore(Boolean restore) { + this.restore = restore; + return this; + } + + /** + * Get the publisherEmail property: Publisher email. + * + * @return the publisherEmail value. + */ + public String publisherEmail() { + return this.publisherEmail; + } + + /** + * Set the publisherEmail property: Publisher email. + * + * @param publisherEmail the publisherEmail value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withPublisherEmail(String publisherEmail) { + this.publisherEmail = publisherEmail; + return this; + } + + /** + * Get the publisherName property: Publisher name. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Set the publisherName property: Publisher name. + * + * @param publisherName the publisherName value to set. + * @return the ApiManagementServiceUpdateParameters object itself. + */ + public ApiManagementServiceUpdateParameters withPublisherName(String publisherName) { + this.publisherName = publisherName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (hostnameConfigurations() != null) { + hostnameConfigurations().forEach(e -> e.validate()); + } + if (virtualNetworkConfiguration() != null) { + virtualNetworkConfiguration().validate(); + } + if (additionalLocations() != null) { + additionalLocations().forEach(e -> e.validate()); + } + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (apiVersionConstraint() != null) { + apiVersionConstraint().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateProperties.java new file mode 100644 index 0000000000000..175aac243de01 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServiceUpdateProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; +import java.util.Map; + +/** Properties of an API Management service resource description. */ +@Fluent +public final class ApiManagementServiceUpdateProperties extends ApiManagementServiceBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementServiceUpdateProperties.class); + + /* + * Publisher email. + */ + @JsonProperty(value = "publisherEmail") + private String publisherEmail; + + /* + * Publisher name. + */ + @JsonProperty(value = "publisherName") + private String publisherName; + + /** + * Get the publisherEmail property: Publisher email. + * + * @return the publisherEmail value. + */ + public String publisherEmail() { + return this.publisherEmail; + } + + /** + * Set the publisherEmail property: Publisher email. + * + * @param publisherEmail the publisherEmail value to set. + * @return the ApiManagementServiceUpdateProperties object itself. + */ + public ApiManagementServiceUpdateProperties withPublisherEmail(String publisherEmail) { + this.publisherEmail = publisherEmail; + return this; + } + + /** + * Get the publisherName property: Publisher name. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Set the publisherName property: Publisher name. + * + * @param publisherName the publisherName value to set. + * @return the ApiManagementServiceUpdateProperties object itself. + */ + public ApiManagementServiceUpdateProperties withPublisherName(String publisherName) { + this.publisherName = publisherName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withNotificationSenderEmail(String notificationSenderEmail) { + super.withNotificationSenderEmail(notificationSenderEmail); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withHostnameConfigurations( + List hostnameConfigurations) { + super.withHostnameConfigurations(hostnameConfigurations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withVirtualNetworkConfiguration( + VirtualNetworkConfiguration virtualNetworkConfiguration) { + super.withVirtualNetworkConfiguration(virtualNetworkConfiguration); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withAdditionalLocations(List additionalLocations) { + super.withAdditionalLocations(additionalLocations); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withCustomProperties(Map customProperties) { + super.withCustomProperties(customProperties); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withCertificates(List certificates) { + super.withCertificates(certificates); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withEnableClientCertificate(Boolean enableClientCertificate) { + super.withEnableClientCertificate(enableClientCertificate); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withDisableGateway(Boolean disableGateway) { + super.withDisableGateway(disableGateway); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withVirtualNetworkType(VirtualNetworkType virtualNetworkType) { + super.withVirtualNetworkType(virtualNetworkType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withApiVersionConstraint(ApiVersionConstraint apiVersionConstraint) { + super.withApiVersionConstraint(apiVersionConstraint); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiManagementServiceUpdateProperties withRestore(Boolean restore) { + super.withRestore(restore); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServices.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServices.java new file mode 100644 index 0000000000000..11c51b91b1bb5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementServices.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiManagementServices. */ +public interface ApiManagementServices { + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource restore( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the + * current service. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Restore API Management service from backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource restore( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource backup( + String resourceGroupName, String serviceName, ApiManagementServiceBackupRestoreParameters parameters); + + /** + * Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation + * and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the ApiManagementService_Backup operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource backup( + String resourceGroupName, + String serviceName, + ApiManagementServiceBackupRestoreParameters parameters, + Context context); + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + ApiManagementServiceResource getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Gets an API Management service resource description. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an API Management service resource description. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ApiManagementServiceResource deleteByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Deletes an existing API Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ApiManagementServiceResource delete(String resourceGroupName, String serviceName, Context context); + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all API Management services within a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the List API Management services operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + PagedIterable list(); + + /** + * Lists all API Management services 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 the response of the List API Management services operation. + */ + PagedIterable list(Context context); + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + ApiManagementServiceGetSsoTokenResult getSsoToken(String resourceGroupName, String serviceName); + + /** + * Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. + */ + Response getSsoTokenWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + ApiManagementServiceNameAvailabilityResult checkNameAvailability( + ApiManagementServiceCheckNameAvailabilityParameters parameters); + + /** + * Checks availability and correctness of a name for an API Management service. + * + * @param parameters Parameters supplied to the CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of the CheckNameAvailability operation. + */ + Response checkNameAvailabilityWithResponse( + ApiManagementServiceCheckNameAvailabilityParameters parameters, Context context); + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + ApiManagementServiceGetDomainOwnershipIdentifierResult getDomainOwnershipIdentifier(); + + /** + * Get the custom domain ownership identifier for an API Management service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain ownership identifier for an API Management service. + */ + Response getDomainOwnershipIdentifierWithResponse( + Context context); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource applyNetworkConfigurationUpdates(String resourceGroupName, String serviceName); + + /** + * Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, + * all the regions in which the Api Management service is deployed will be updated sequentially without + * incurring downtime in the region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single API Management service resource in List or Get response. + */ + ApiManagementServiceResource applyNetworkConfigurationUpdates( + String resourceGroupName, + String serviceName, + ApiManagementServiceApplyNetworkConfigurationParameters parameters, + Context context); + + /** + * Gets an API Management service resource description. + * + * @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 API Management service resource description. + */ + ApiManagementServiceResource getById(String id); + + /** + * Gets an API Management service resource description. + * + * @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 API Management service resource description. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing API Management service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ApiManagementServiceResource deleteById(String id); + + /** + * Deletes an existing API Management service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ApiManagementServiceResource deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApiManagementServiceResource resource. + * + * @param name resource name. + * @return the first stage of the new ApiManagementServiceResource definition. + */ + ApiManagementServiceResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSku.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSku.java new file mode 100644 index 0000000000000..9a9a03e26b2fa --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSku.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementSkuInner; +import java.util.List; + +/** An immutable client-side representation of ApiManagementSku. */ +public interface ApiManagementSku { + /** + * Gets the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: Specifies the tier of virtual machines in a scale set.<br /><br /> Possible + * Values:<br /><br /> **Standard**<br /><br /> **Basic**. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the size property: The Size of the SKU. + * + * @return the size value. + */ + String size(); + + /** + * Gets the family property: The Family of this particular SKU. + * + * @return the family value. + */ + String family(); + + /** + * Gets the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the capacity property: Specifies the number of virtual machines in the scale set. + * + * @return the capacity value. + */ + ApiManagementSkuCapacity capacity(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: A list of locations and availability zones in those locations where the SKU is + * available. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * Gets the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + List costs(); + + /** + * Gets the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementSkuInner object. + * + * @return the inner object. + */ + ApiManagementSkuInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapabilities.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapabilities.java new file mode 100644 index 0000000000000..f6378f987cef5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapabilities.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.apimanagement.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 The SKU capabilities object. */ +@Immutable +public final class ApiManagementSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuCapabilities.class); + + /* + * An invariant to describe the feature. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * An invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: An invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: An invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacity.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacity.java new file mode 100644 index 0000000000000..e1c04c94b923c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacity.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 scaling information of a SKU. */ +@Immutable +public final class ApiManagementSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuCapacity.class); + + /* + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Integer minimum; + + /* + * The maximum capacity that can be set. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Integer maximum; + + /* + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Integer defaultProperty; + + /* + * The scale type applicable to the sku. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ApiManagementSkuCapacityScaleType scaleType; + + /** + * Get the minimum property: The minimum capacity. + * + * @return the minimum value. + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Get the maximum property: The maximum capacity that can be set. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Get the defaultProperty property: The default capacity. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scaleType property: The scale type applicable to the sku. + * + * @return the scaleType value. + */ + public ApiManagementSkuCapacityScaleType scaleType() { + return this.scaleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacityScaleType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacityScaleType.java new file mode 100644 index 0000000000000..4b62b64befc07 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCapacityScaleType.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ApiManagementSkuCapacityScaleType. */ +public enum ApiManagementSkuCapacityScaleType { + /** Enum value Automatic. */ + AUTOMATIC("Automatic"), + + /** Enum value Manual. */ + MANUAL("Manual"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ApiManagementSkuCapacityScaleType instance. */ + private final String value; + + ApiManagementSkuCapacityScaleType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ApiManagementSkuCapacityScaleType instance. + * + * @param value the serialized value to parse. + * @return the parsed ApiManagementSkuCapacityScaleType object, or null if unable to parse. + */ + @JsonCreator + public static ApiManagementSkuCapacityScaleType fromString(String value) { + ApiManagementSkuCapacityScaleType[] items = ApiManagementSkuCapacityScaleType.values(); + for (ApiManagementSkuCapacityScaleType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCosts.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCosts.java new file mode 100644 index 0000000000000..e902c68cd1674 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuCosts.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.apimanagement.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 metadata for retrieving price info. */ +@Immutable +public final class ApiManagementSkuCosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuCosts.class); + + /* + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /* + * The multiplier is needed to extend the base metered cost. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /* + * An invariant to show the extended unit. + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get the meterId property: Used for querying price from commerce. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the quantity property: The multiplier is needed to extend the base metered cost. + * + * @return the quantity value. + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get the extendedUnit property: An invariant to show the extended unit. + * + * @return the extendedUnit value. + */ + public String extendedUnit() { + return this.extendedUnit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuLocationInfo.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuLocationInfo.java new file mode 100644 index 0000000000000..bd8335cba440d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuLocationInfo.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.apimanagement.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 ApiManagementSkuLocationInfo model. */ +@Immutable +public final class ApiManagementSkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuLocationInfo.class); + + /* + * Location of the SKU + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * List of availability zones where the SKU is supported. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /* + * Details of capabilities available to a SKU in specific zones. + */ + @JsonProperty(value = "zoneDetails", access = JsonProperty.Access.WRITE_ONLY) + private List zoneDetails; + + /** + * Get the location property: Location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the zones property: List of availability zones where the SKU is supported. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the zoneDetails property: Details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionInfo.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionInfo.java new file mode 100644 index 0000000000000..6e34f3180ef3b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionInfo.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.apimanagement.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 ApiManagementSkuRestrictionInfo model. */ +@Immutable +public final class ApiManagementSkuRestrictionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuRestrictionInfo.class); + + /* + * Locations where the SKU is restricted + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * List of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /** + * Get the locations property: Locations where the SKU is restricted. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the zones property: List of availability zones where the SKU is restricted. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictions.java new file mode 100644 index 0000000000000..8ba2e559eb0e8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictions.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 scaling information of a SKU. */ +@Immutable +public final class ApiManagementSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuRestrictions.class); + + /* + * The type of restrictions. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ApiManagementSkuRestrictionsType type; + + /* + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo", access = JsonProperty.Access.WRITE_ONLY) + private ApiManagementSkuRestrictionInfo restrictionInfo; + + /* + * The reason for restriction. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private ApiManagementSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type property: The type of restrictions. + * + * @return the type value. + */ + public ApiManagementSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the values property: The value of restrictions. If the restriction type is set to location. This would be + * different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the restrictionInfo property: The information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value. + */ + public ApiManagementSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Get the reasonCode property: The reason for restriction. + * + * @return the reasonCode value. + */ + public ApiManagementSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restrictionInfo() != null) { + restrictionInfo().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsReasonCode.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..260c9ca639307 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsReasonCode.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ApiManagementSkuRestrictionsReasonCode. */ +public enum ApiManagementSkuRestrictionsReasonCode { + /** Enum value QuotaId. */ + QUOTA_ID("QuotaId"), + + /** Enum value NotAvailableForSubscription. */ + NOT_AVAILABLE_FOR_SUBSCRIPTION("NotAvailableForSubscription"); + + /** The actual serialized value for a ApiManagementSkuRestrictionsReasonCode instance. */ + private final String value; + + ApiManagementSkuRestrictionsReasonCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ApiManagementSkuRestrictionsReasonCode instance. + * + * @param value the serialized value to parse. + * @return the parsed ApiManagementSkuRestrictionsReasonCode object, or null if unable to parse. + */ + @JsonCreator + public static ApiManagementSkuRestrictionsReasonCode fromString(String value) { + ApiManagementSkuRestrictionsReasonCode[] items = ApiManagementSkuRestrictionsReasonCode.values(); + for (ApiManagementSkuRestrictionsReasonCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsType.java new file mode 100644 index 0000000000000..fa3b0103b20bd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuRestrictionsType.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ApiManagementSkuRestrictionsType. */ +public enum ApiManagementSkuRestrictionsType { + /** Enum value Location. */ + LOCATION("Location"), + + /** Enum value Zone. */ + ZONE("Zone"); + + /** The actual serialized value for a ApiManagementSkuRestrictionsType instance. */ + private final String value; + + ApiManagementSkuRestrictionsType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ApiManagementSkuRestrictionsType instance. + * + * @param value the serialized value to parse. + * @return the parsed ApiManagementSkuRestrictionsType object, or null if unable to parse. + */ + @JsonCreator + public static ApiManagementSkuRestrictionsType fromString(String value) { + ApiManagementSkuRestrictionsType[] items = ApiManagementSkuRestrictionsType.values(); + for (ApiManagementSkuRestrictionsType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuZoneDetails.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuZoneDetails.java new file mode 100644 index 0000000000000..021e09471f648 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkuZoneDetails.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.apimanagement.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 The zonal capabilities of a SKU. */ +@Immutable +public final class ApiManagementSkuZoneDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkuZoneDetails.class); + + /* + * The set of zones that the SKU is available in with the specified + * capabilities. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private List name; + + /* + * A list of capabilities that are available for the SKU in the specified + * list of zones. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * Get the name property: The set of zones that the SKU is available in with the specified capabilities. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Get the capabilities property: A list of capabilities that are available for the SKU in the specified list of + * zones. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkus.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkus.java new file mode 100644 index 0000000000000..f07a9a9d52f61 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkus.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApiManagementSkus. */ +public interface ApiManagementSkus { + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Microsoft. + */ + PagedIterable list(); + + /** + * Gets the list of Microsoft.ApiManagement SKUs available for your 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 the list of Microsoft. + */ + PagedIterable list(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkusResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkusResult.java new file mode 100644 index 0000000000000..210db952232cc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiManagementSkusResult.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiManagementSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Resource Skus operation response. */ +@Fluent +public final class ApiManagementSkusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementSkusResult.class); + + /* + * The list of skus available for the subscription. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The URI to fetch the next page of Resource Skus. Call ListNext() with + * this URI to fetch the next page of Resource Skus + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of skus available for the subscription. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of skus available for the subscription. + * + * @param value the value value to set. + * @return the ApiManagementSkusResult object itself. + */ + public ApiManagementSkusResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to + * fetch the next page of Resource Skus. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ApiManagementSkusResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPolicies.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPolicies.java new file mode 100644 index 0000000000000..94ee6aa0dfdc5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPolicies.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApiOperationPolicies. */ +public interface ApiOperationPolicies { + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + PolicyCollection listByOperation(String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Get the list of policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of policy configuration at the API Operation level. + */ + Response listByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context); + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 getEntityTag( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId); + + /** + * Gets the entity state (Etag) version of the API operation policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 entity state (Etag) version of the API operation policy specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + Context context); + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the 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 policy configuration at the API Operation level. + */ + PolicyContract get( + String resourceGroupName, String serviceName, String apiId, String operationId, PolicyIdName policyId); + + /** + * Get the policy configuration at the API Operation level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch); + + /** + * Deletes the policy configuration at the Api Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + PolicyIdName policyId, + String ifMatch, + Context context); + + /** + * Get the policy configuration at the API Operation level. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + PolicyContract getById(String id); + + /** + * Get the policy configuration at the API Operation level. + * + * @param id the resource ID. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API Operation level. + */ + Response getByIdWithResponse(String id, PolicyExportFormat format, Context context); + + /** + * Deletes the policy configuration at the Api Operation. + * + * @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 the policy configuration at the Api Operation. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new PolicyContract resource. + * + * @param name resource name. + * @return the first stage of the new PolicyContract definition. + */ + PolicyContract.DefinitionStages.Blank define(PolicyIdName name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..42f9ec19b7f84 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateHeaders.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.apimanagement.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 ApiOperationPoliciesCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiOperationPoliciesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationPoliciesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationPoliciesCreateOrUpdateHeaders object itself. + */ + public ApiOperationPoliciesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..ec5f8b1e71d69 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiOperationPoliciesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiOperationPoliciesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiOperationPoliciesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationPoliciesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + ApiOperationPoliciesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..dcbcecb3299bc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagHeaders.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.apimanagement.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 ApiOperationPoliciesGetEntityTagHeaders model. */ +@Fluent +public final class ApiOperationPoliciesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationPoliciesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationPoliciesGetEntityTagHeaders object itself. + */ + public ApiOperationPoliciesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagResponse.java new file mode 100644 index 0000000000000..b189dca57f531 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiOperationPoliciesGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of ApiOperationPoliciesGetEntityTagResponse. + * + * @param request the request which resulted in this ApiOperationPoliciesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationPoliciesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiOperationPoliciesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetHeaders.java new file mode 100644 index 0000000000000..4f18aead4e14c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetHeaders.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.apimanagement.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 ApiOperationPoliciesGetHeaders model. */ +@Fluent +public final class ApiOperationPoliciesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationPoliciesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationPoliciesGetHeaders object itself. + */ + public ApiOperationPoliciesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetResponse.java new file mode 100644 index 0000000000000..b918bb7cc59db --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationPoliciesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiOperationPoliciesGetResponse + extends ResponseBase { + /** + * Creates an instance of ApiOperationPoliciesGetResponse. + * + * @param request the request which resulted in this ApiOperationPoliciesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationPoliciesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + ApiOperationPoliciesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperations.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperations.java new file mode 100644 index 0000000000000..7c99ce2e4ca85 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperations.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiOperations. */ +public interface ApiOperations { + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists a collection of the operations for the specified API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Operation list representation. + */ + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + String tags, + Context context); + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Gets the entity state (Etag) version of the API operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API operation specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context); + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + OperationContract get(String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, Context context); + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String operationId, String ifMatch); + + /** + * Deletes the specified operation in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String ifMatch, + Context context); + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + OperationContract getById(String id); + + /** + * Gets the details of the API Operation specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API Operation specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified operation in the API. + * + * @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 the specified operation in the API. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new OperationContract resource. + * + * @param name resource name. + * @return the first stage of the new OperationContract definition. + */ + OperationContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..668badd177dab --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateHeaders.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.apimanagement.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 ApiOperationsCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiOperationsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationsCreateOrUpdateHeaders object itself. + */ + public ApiOperationsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..ddf16bda0a0e7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiOperationsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiOperationsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiOperationsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationContractInner value, + ApiOperationsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OperationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..129d960e1ca46 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagHeaders.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.apimanagement.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 ApiOperationsGetEntityTagHeaders model. */ +@Fluent +public final class ApiOperationsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationsGetEntityTagHeaders object itself. + */ + public ApiOperationsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagResponse.java new file mode 100644 index 0000000000000..0d21c8bf0fc92 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiOperationsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiOperationsGetEntityTagResponse. + * + * @param request the request which resulted in this ApiOperationsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiOperationsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetHeaders.java new file mode 100644 index 0000000000000..e2e6d83d01342 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetHeaders.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.apimanagement.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 ApiOperationsGetHeaders model. */ +@Fluent +public final class ApiOperationsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationsGetHeaders object itself. + */ + public ApiOperationsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetResponse.java new file mode 100644 index 0000000000000..b334a212fff52 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiOperationsGetResponse extends ResponseBase { + /** + * Creates an instance of ApiOperationsGetResponse. + * + * @param request the request which resulted in this ApiOperationsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationContractInner value, + ApiOperationsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OperationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateHeaders.java new file mode 100644 index 0000000000000..f43454c73ef5a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateHeaders.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.apimanagement.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 ApiOperationsUpdateHeaders model. */ +@Fluent +public final class ApiOperationsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiOperationsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiOperationsUpdateHeaders object itself. + */ + public ApiOperationsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateResponse.java new file mode 100644 index 0000000000000..54df9d0d047ed --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiOperationsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; + +/** Contains all response data for the update operation. */ +public final class ApiOperationsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiOperationsUpdateResponse. + * + * @param request the request which resulted in this ApiOperationsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiOperationsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationContractInner value, + ApiOperationsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OperationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPolicies.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPolicies.java new file mode 100644 index 0000000000000..4d2c974693203 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPolicies.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Resource collection API of ApiPolicies. */ +public interface ApiPolicies { + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + PolicyCollection listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + Response listByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId); + + /** + * Gets the entity state (Etag) version of the API policy specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 entity state (Etag) version of the API policy specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId, Context context); + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the 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 policy configuration at the API level. + */ + PolicyContract get(String resourceGroupName, String serviceName, String apiId, PolicyIdName policyId); + + /** + * Get the policy configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the API level. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + PolicyContract createOrUpdate( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters); + + /** + * Creates or updates policy configuration for the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, PolicyIdName policyId, String ifMatch); + + /** + * Deletes the policy configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + PolicyIdName policyId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..3ab02f5b3891d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateHeaders.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.apimanagement.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 ApiPoliciesCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiPoliciesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPoliciesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiPoliciesCreateOrUpdateHeaders object itself. + */ + public ApiPoliciesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..cb15cbbfcb8e1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiPoliciesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiPoliciesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiPoliciesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiPoliciesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + ApiPoliciesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..bd1b14dcc3568 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagHeaders.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.apimanagement.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 ApiPoliciesGetEntityTagHeaders model. */ +@Fluent +public final class ApiPoliciesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPoliciesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiPoliciesGetEntityTagHeaders object itself. + */ + public ApiPoliciesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagResponse.java new file mode 100644 index 0000000000000..e724b756f4ccd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiPoliciesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiPoliciesGetEntityTagResponse. + * + * @param request the request which resulted in this ApiPoliciesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiPoliciesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiPoliciesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetHeaders.java new file mode 100644 index 0000000000000..ca9fdf0c3729a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetHeaders.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.apimanagement.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 ApiPoliciesGetHeaders model. */ +@Fluent +public final class ApiPoliciesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPoliciesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiPoliciesGetHeaders object itself. + */ + public ApiPoliciesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetResponse.java new file mode 100644 index 0000000000000..0215af5e4151d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiPoliciesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiPoliciesGetResponse extends ResponseBase { + /** + * Creates an instance of ApiPoliciesGetResponse. + * + * @param request the request which resulted in this ApiPoliciesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiPoliciesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + ApiPoliciesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiProducts.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiProducts.java new file mode 100644 index 0000000000000..bd9d156520514 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiProducts.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApiProducts. */ +public interface ApiProducts { + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + PagedIterable listByApis(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all Products, which the API is part of. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + PagedIterable listByApis( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseCollection.java new file mode 100644 index 0000000000000..1e32a6526df46 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged ApiRelease list representation. */ +@Fluent +public final class ApiReleaseCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleaseCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the ApiReleaseCollection object itself. + */ + public ApiReleaseCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseContract.java new file mode 100644 index 0000000000000..a4d14ac34cdbe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleaseContract.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ApiReleaseContract. */ +public interface ApiReleaseContract { + /** + * 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 apiId property: Identifier of the API the release belongs to. + * + * @return the apiId value. + */ + String apiId(); + + /** + * Gets the createdDateTime property: The time the API was released. The date conforms to the following format: + * yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the updatedDateTime property: The time the API release was updated. + * + * @return the updatedDateTime value. + */ + OffsetDateTime updatedDateTime(); + + /** + * Gets the notes property: Release Notes. + * + * @return the notes value. + */ + String notes(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner object. + * + * @return the inner object. + */ + ApiReleaseContractInner innerModel(); + + /** The entirety of the ApiReleaseContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ApiReleaseContract definition stages. */ + interface DefinitionStages { + /** The first stage of the ApiReleaseContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ApiReleaseContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @return the next definition stage. + */ + WithCreate withExistingApi(String resourceGroupName, String serviceName, String apiId); + } + /** + * The stage of the ApiReleaseContract 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.WithApiId, DefinitionStages.WithNotes, DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiReleaseContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiReleaseContract create(Context context); + } + /** The stage of the ApiReleaseContract definition allowing to specify apiId. */ + interface WithApiId { + /** + * Specifies the apiId property: Identifier of the API the release belongs to.. + * + * @param apiId Identifier of the API the release belongs to. + * @return the next definition stage. + */ + WithCreate withApiId(String apiId); + } + /** The stage of the ApiReleaseContract definition allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: Release Notes. + * + * @param notes Release Notes. + * @return the next definition stage. + */ + WithCreate withNotes(String notes); + } + /** The stage of the ApiReleaseContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the ApiReleaseContract resource. + * + * @return the stage of resource update. + */ + ApiReleaseContract.Update update(); + + /** The template for ApiReleaseContract update. */ + interface Update extends UpdateStages.WithApiId, UpdateStages.WithNotes, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiReleaseContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiReleaseContract apply(Context context); + } + /** The ApiReleaseContract update stages. */ + interface UpdateStages { + /** The stage of the ApiReleaseContract update allowing to specify apiId. */ + interface WithApiId { + /** + * Specifies the apiId property: Identifier of the API the release belongs to.. + * + * @param apiId Identifier of the API the release belongs to. + * @return the next definition stage. + */ + Update withApiId(String apiId); + } + /** The stage of the ApiReleaseContract update allowing to specify notes. */ + interface WithNotes { + /** + * Specifies the notes property: Release Notes. + * + * @param notes Release Notes. + * @return the next definition stage. + */ + Update withNotes(String notes); + } + /** The stage of the ApiReleaseContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiReleaseContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiReleaseContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleases.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleases.java new file mode 100644 index 0000000000000..510c730e3ab8c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleases.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ApiReleases. */ +public interface ApiReleases { + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all releases of an API. An API release is created when making an API Revision current. Releases are also + * used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip + * parameters. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| notes | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged ApiRelease list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String releaseId); + + /** + * Returns the etag of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context); + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + ApiReleaseContract get(String resourceGroupName, String serviceName, String apiId, String releaseId); + + /** + * Returns the details of an API release. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apiRelease details. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, Context context); + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String releaseId, String ifMatch); + + /** + * Deletes the specified release in the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param releaseId Release identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String apiId, String releaseId, String ifMatch, Context context); + + /** + * Returns the details of an API release. + * + * @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 apiRelease details. + */ + ApiReleaseContract getById(String id); + + /** + * Returns the details of an API release. + * + * @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 apiRelease details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified release in the API. + * + * @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 the specified release in the API. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new ApiReleaseContract resource. + * + * @param name resource name. + * @return the first stage of the new ApiReleaseContract definition. + */ + ApiReleaseContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..85048800bd672 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateHeaders.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.apimanagement.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 ApiReleasesCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiReleasesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleasesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiReleasesCreateOrUpdateHeaders object itself. + */ + public ApiReleasesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..0762f65c7942c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiReleasesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiReleasesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiReleasesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiReleasesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiReleaseContractInner value, + ApiReleasesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiReleaseContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..7c0ea1a3c20b9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagHeaders.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.apimanagement.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 ApiReleasesGetEntityTagHeaders model. */ +@Fluent +public final class ApiReleasesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleasesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiReleasesGetEntityTagHeaders object itself. + */ + public ApiReleasesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagResponse.java new file mode 100644 index 0000000000000..f848861e4afbe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiReleasesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiReleasesGetEntityTagResponse. + * + * @param request the request which resulted in this ApiReleasesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiReleasesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiReleasesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetHeaders.java new file mode 100644 index 0000000000000..491b37ff2f02b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetHeaders.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.apimanagement.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 ApiReleasesGetHeaders model. */ +@Fluent +public final class ApiReleasesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleasesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiReleasesGetHeaders object itself. + */ + public ApiReleasesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetResponse.java new file mode 100644 index 0000000000000..e0d586a4beb7f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiReleasesGetResponse extends ResponseBase { + /** + * Creates an instance of ApiReleasesGetResponse. + * + * @param request the request which resulted in this ApiReleasesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiReleasesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiReleaseContractInner value, + ApiReleasesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiReleaseContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateHeaders.java new file mode 100644 index 0000000000000..c81648b94beb5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateHeaders.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.apimanagement.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 ApiReleasesUpdateHeaders model. */ +@Fluent +public final class ApiReleasesUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiReleasesUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiReleasesUpdateHeaders object itself. + */ + public ApiReleasesUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateResponse.java new file mode 100644 index 0000000000000..0b0550759ef28 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiReleasesUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiReleaseContractInner; + +/** Contains all response data for the update operation. */ +public final class ApiReleasesUpdateResponse extends ResponseBase { + /** + * Creates an instance of ApiReleasesUpdateResponse. + * + * @param request the request which resulted in this ApiReleasesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiReleasesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiReleaseContractInner value, + ApiReleasesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiReleaseContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionCollection.java new file mode 100644 index 0000000000000..a87fbcda6a071 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiRevisionContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Api Revision list representation. */ +@Fluent +public final class ApiRevisionCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiRevisionCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the ApiRevisionCollection object itself. + */ + public ApiRevisionCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionContract.java new file mode 100644 index 0000000000000..5e9e5dc6b8378 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisionContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ApiRevisionContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ApiRevisionContract. */ +public interface ApiRevisionContract { + /** + * Gets the apiId property: Identifier of the API Revision. + * + * @return the apiId value. + */ + String apiId(); + + /** + * Gets the apiRevision property: Revision number of API. + * + * @return the apiRevision value. + */ + String apiRevision(); + + /** + * Gets the createdDateTime property: The time the API Revision was created. The date conforms to the following + * format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the updatedDateTime property: The time the API Revision were updated. The date conforms to the following + * format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the updatedDateTime value. + */ + OffsetDateTime updatedDateTime(); + + /** + * Gets the description property: Description of the API Revision. + * + * @return the description value. + */ + String description(); + + /** + * Gets the privateUrl property: Gateway URL for accessing the non-current API Revision. + * + * @return the privateUrl value. + */ + String privateUrl(); + + /** + * Gets the isOnline property: Indicates if API revision is the current api revision. + * + * @return the isOnline value. + */ + Boolean isOnline(); + + /** + * Gets the isCurrent property: Indicates if API revision is accessible via the gateway. + * + * @return the isCurrent value. + */ + Boolean isCurrent(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiRevisionContractInner object. + * + * @return the inner object. + */ + ApiRevisionContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisions.java new file mode 100644 index 0000000000000..fe862590eeb1b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiRevisions.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ApiRevisions. */ +public interface ApiRevisions { + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all revisions of an API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| apiRevision | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Revision list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemas.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemas.java new file mode 100644 index 0000000000000..bcc88623a1f3e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemas.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.apimanagement.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 ApiSchemas. */ +public interface ApiSchemas { + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| contentType | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String schemaId); + + /** + * Gets the entity state (Etag) version of the schema specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the schema specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context); + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + SchemaContract get(String resourceGroupName, String serviceName, String apiId, String schemaId); + + /** + * Get the schema configuration at the API level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String schemaId, Context context); + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String schemaId, String ifMatch); + + /** + * Deletes the schema configuration at the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param schemaId Schema identifier within an API. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String schemaId, + String ifMatch, + Boolean force, + Context context); + + /** + * Get the schema configuration at the API level. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + SchemaContract getById(String id); + + /** + * Get the schema configuration at the API level. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schema configuration at the API level. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the schema configuration at the Api. + * + * @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 the schema configuration at the Api. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param force If true removes all references to the schema before deleting it. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Boolean force, Context context); + + /** + * Begins definition for a new SchemaContract resource. + * + * @param name resource name. + * @return the first stage of the new SchemaContract definition. + */ + SchemaContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..f9f8ee309ed62 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateHeaders.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.apimanagement.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 ApiSchemasCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiSchemasCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiSchemasCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiSchemasCreateOrUpdateHeaders object itself. + */ + public ApiSchemasCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..f056f4a8dd19f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiSchemasCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiSchemasCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiSchemasCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiSchemasCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SchemaContractInner value, + ApiSchemasCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SchemaContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagHeaders.java new file mode 100644 index 0000000000000..5f84ea48276a5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagHeaders.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.apimanagement.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 ApiSchemasGetEntityTagHeaders model. */ +@Fluent +public final class ApiSchemasGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiSchemasGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiSchemasGetEntityTagHeaders object itself. + */ + public ApiSchemasGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagResponse.java new file mode 100644 index 0000000000000..7fc291cd3fa70 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiSchemasGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiSchemasGetEntityTagResponse. + * + * @param request the request which resulted in this ApiSchemasGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiSchemasGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiSchemasGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetHeaders.java new file mode 100644 index 0000000000000..31d37da0b0b5b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetHeaders.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.apimanagement.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 ApiSchemasGetHeaders model. */ +@Fluent +public final class ApiSchemasGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiSchemasGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiSchemasGetHeaders object itself. + */ + public ApiSchemasGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetResponse.java new file mode 100644 index 0000000000000..ae4ee2d6d40a7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiSchemasGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiSchemasGetResponse extends ResponseBase { + /** + * Creates an instance of ApiSchemasGetResponse. + * + * @param request the request which resulted in this ApiSchemasGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiSchemasGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SchemaContractInner value, + ApiSchemasGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SchemaContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptions.java new file mode 100644 index 0000000000000..4d84e12ef12d2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptions.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.apimanagement.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 ApiTagDescriptions. */ +public interface ApiTagDescriptions { + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API level + * but tag may be assigned to the Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged TagDescription list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId, String tagDescriptionId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context); + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + TagDescriptionContract get(String resourceGroupName, String serviceName, String apiId, String tagDescriptionId); + + /** + * Get Tag description in scope of API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag description in scope of API. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagDescriptionId, Context context); + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String tagDescriptionId, String ifMatch); + + /** + * Delete tag description for the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagDescriptionId Tag description identifier. Used when creating tagDescription for API/Tag association. + * Based on API and Tag names. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String tagDescriptionId, + String ifMatch, + Context context); + + /** + * Get Tag description in scope of API. + * + * @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 tag description in scope of API. + */ + TagDescriptionContract getById(String id); + + /** + * Get Tag description in scope of API. + * + * @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 tag description in scope of API. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete tag description for the Api. + * + * @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); + + /** + * Delete tag description for the Api. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new TagDescriptionContract resource. + * + * @param name resource name. + * @return the first stage of the new TagDescriptionContract definition. + */ + TagDescriptionContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..1b26a7d806c2a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateHeaders.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.apimanagement.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 ApiTagDescriptionsCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiTagDescriptionsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiTagDescriptionsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiTagDescriptionsCreateOrUpdateHeaders object itself. + */ + public ApiTagDescriptionsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..2d3be54ba4e19 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiTagDescriptionsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiTagDescriptionsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiTagDescriptionsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiTagDescriptionsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagDescriptionContractInner value, + ApiTagDescriptionsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagDescriptionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..ff728038caed5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagHeaders.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.apimanagement.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 ApiTagDescriptionsGetEntityTagHeaders model. */ +@Fluent +public final class ApiTagDescriptionsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiTagDescriptionsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiTagDescriptionsGetEntityTagHeaders object itself. + */ + public ApiTagDescriptionsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagResponse.java new file mode 100644 index 0000000000000..5072e31cc1cd8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiTagDescriptionsGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of ApiTagDescriptionsGetEntityTagResponse. + * + * @param request the request which resulted in this ApiTagDescriptionsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiTagDescriptionsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiTagDescriptionsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetHeaders.java new file mode 100644 index 0000000000000..faf56dec99764 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetHeaders.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.apimanagement.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 ApiTagDescriptionsGetHeaders model. */ +@Fluent +public final class ApiTagDescriptionsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiTagDescriptionsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiTagDescriptionsGetHeaders object itself. + */ + public ApiTagDescriptionsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetResponse.java new file mode 100644 index 0000000000000..b54939918f3c0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagDescriptionsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiTagDescriptionsGetResponse + extends ResponseBase { + /** + * Creates an instance of ApiTagDescriptionsGetResponse. + * + * @param request the request which resulted in this ApiTagDescriptionsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiTagDescriptionsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagDescriptionContractInner value, + ApiTagDescriptionsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagDescriptionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagResourceContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagResourceContractProperties.java new file mode 100644 index 0000000000000..b9da0c70c8808 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiTagResourceContractProperties.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** API contract properties for the Tag Resources. */ +@Fluent +public final class ApiTagResourceContractProperties extends ApiEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiTagResourceContractProperties.class); + + /* + * API identifier in the form /apis/{apiId}. + */ + @JsonProperty(value = "id") + private String id; + + /* + * API name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Absolute URL of the backend service implementing this API. + */ + @JsonProperty(value = "serviceUrl") + private String serviceUrl; + + /* + * Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API + * endpoint base URL specified during the service instance creation to form + * a public URL for this API. + */ + @JsonProperty(value = "path") + private String path; + + /* + * Describes on which protocols the operations in this API can be invoked. + */ + @JsonProperty(value = "protocols") + private List protocols; + + /** + * Get the id property: API identifier in the form /apis/{apiId}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: API identifier in the form /apis/{apiId}. + * + * @param id the id value to set. + * @return the ApiTagResourceContractProperties object itself. + */ + public ApiTagResourceContractProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: API name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: API name. + * + * @param name the name value to set. + * @return the ApiTagResourceContractProperties object itself. + */ + public ApiTagResourceContractProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the serviceUrl property: Absolute URL of the backend service implementing this API. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Set the serviceUrl property: Absolute URL of the backend service implementing this API. + * + * @param serviceUrl the serviceUrl value to set. + * @return the ApiTagResourceContractProperties object itself. + */ + public ApiTagResourceContractProperties withServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + return this; + } + + /** + * Get the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @param path the path value to set. + * @return the ApiTagResourceContractProperties object itself. + */ + public ApiTagResourceContractProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @param protocols the protocols value to set. + * @return the ApiTagResourceContractProperties object itself. + */ + public ApiTagResourceContractProperties withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withAuthenticationSettings( + AuthenticationSettingsContract authenticationSettings) { + super.withAuthenticationSettings(authenticationSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + super.withSubscriptionKeyParameterNames(subscriptionKeyParameterNames); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withApiType(ApiType apiType) { + super.withApiType(apiType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withApiRevision(String apiRevision) { + super.withApiRevision(apiRevision); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withApiVersion(String apiVersion) { + super.withApiVersion(apiVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withIsCurrent(Boolean isCurrent) { + super.withIsCurrent(isCurrent); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withApiRevisionDescription(String apiRevisionDescription) { + super.withApiRevisionDescription(apiRevisionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withApiVersionDescription(String apiVersionDescription) { + super.withApiVersionDescription(apiVersionDescription); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withApiVersionSetId(String apiVersionSetId) { + super.withApiVersionSetId(apiVersionSetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiTagResourceContractProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiType.java new file mode 100644 index 0000000000000..69946224a9f21 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApiType. */ +public final class ApiType extends ExpandableStringEnum { + /** Static value http for ApiType. */ + public static final ApiType HTTP = fromString("http"); + + /** Static value soap for ApiType. */ + public static final ApiType SOAP = fromString("soap"); + + /** + * Creates or finds a ApiType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApiType. + */ + @JsonCreator + public static ApiType fromString(String name) { + return fromString(name, ApiType.class); + } + + /** @return known ApiType values. */ + public static Collection values() { + return values(ApiType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiUpdateContract.java new file mode 100644 index 0000000000000..dacd72b2dd856 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiUpdateContract.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API update contract details. */ +@JsonFlatten +@Fluent +public class ApiUpdateContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiUpdateContract.class); + + /* + * Description of the API. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Collection of authentication settings included into this API. + */ + @JsonProperty(value = "properties.authenticationSettings") + private AuthenticationSettingsContract authenticationSettings; + + /* + * Protocols over which API is made available. + */ + @JsonProperty(value = "properties.subscriptionKeyParameterNames") + private SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames; + + /* + * Type of API. + */ + @JsonProperty(value = "properties.type") + private ApiType apiType; + + /* + * Describes the Revision of the Api. If no value is provided, default + * revision 1 is created + */ + @JsonProperty(value = "properties.apiRevision") + private String apiRevision; + + /* + * Indicates the Version identifier of the API if the API is versioned + */ + @JsonProperty(value = "properties.apiVersion") + private String apiVersion; + + /* + * Indicates if API revision is current api revision. + */ + @JsonProperty(value = "properties.isCurrent") + private Boolean isCurrent; + + /* + * Indicates if API revision is accessible via the gateway. + */ + @JsonProperty(value = "properties.isOnline", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isOnline; + + /* + * Description of the Api Revision. + */ + @JsonProperty(value = "properties.apiRevisionDescription") + private String apiRevisionDescription; + + /* + * Description of the Api Version. + */ + @JsonProperty(value = "properties.apiVersionDescription") + private String apiVersionDescription; + + /* + * A resource identifier for the related ApiVersionSet. + */ + @JsonProperty(value = "properties.apiVersionSetId") + private String apiVersionSetId; + + /* + * Specifies whether an API or Product subscription is required for + * accessing the API. + */ + @JsonProperty(value = "properties.subscriptionRequired") + private Boolean subscriptionRequired; + + /* + * API name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Absolute URL of the backend service implementing this API. + */ + @JsonProperty(value = "properties.serviceUrl") + private String serviceUrl; + + /* + * Relative URL uniquely identifying this API and all of its resource paths + * within the API Management service instance. It is appended to the API + * endpoint base URL specified during the service instance creation to form + * a public URL for this API. + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * Describes on which protocols the operations in this API can be invoked. + */ + @JsonProperty(value = "properties.protocols") + private List protocols; + + /** + * Get the description property: Description of the API. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the API. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authenticationSettings property: Collection of authentication settings included into this API. + * + * @return the authenticationSettings value. + */ + public AuthenticationSettingsContract authenticationSettings() { + return this.authenticationSettings; + } + + /** + * Set the authenticationSettings property: Collection of authentication settings included into this API. + * + * @param authenticationSettings the authenticationSettings value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withAuthenticationSettings(AuthenticationSettingsContract authenticationSettings) { + this.authenticationSettings = authenticationSettings; + return this; + } + + /** + * Get the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @return the subscriptionKeyParameterNames value. + */ + public SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames() { + return this.subscriptionKeyParameterNames; + } + + /** + * Set the subscriptionKeyParameterNames property: Protocols over which API is made available. + * + * @param subscriptionKeyParameterNames the subscriptionKeyParameterNames value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withSubscriptionKeyParameterNames( + SubscriptionKeyParameterNamesContract subscriptionKeyParameterNames) { + this.subscriptionKeyParameterNames = subscriptionKeyParameterNames; + return this; + } + + /** + * Get the apiType property: Type of API. + * + * @return the apiType value. + */ + public ApiType apiType() { + return this.apiType; + } + + /** + * Set the apiType property: Type of API. + * + * @param apiType the apiType value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withApiType(ApiType apiType) { + this.apiType = apiType; + return this; + } + + /** + * Get the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @return the apiRevision value. + */ + public String apiRevision() { + return this.apiRevision; + } + + /** + * Set the apiRevision property: Describes the Revision of the Api. If no value is provided, default revision 1 is + * created. + * + * @param apiRevision the apiRevision value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withApiRevision(String apiRevision) { + this.apiRevision = apiRevision; + return this; + } + + /** + * Get the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion property: Indicates the Version identifier of the API if the API is versioned. + * + * @param apiVersion the apiVersion value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get the isCurrent property: Indicates if API revision is current api revision. + * + * @return the isCurrent value. + */ + public Boolean isCurrent() { + return this.isCurrent; + } + + /** + * Set the isCurrent property: Indicates if API revision is current api revision. + * + * @param isCurrent the isCurrent value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withIsCurrent(Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get the isOnline property: Indicates if API revision is accessible via the gateway. + * + * @return the isOnline value. + */ + public Boolean isOnline() { + return this.isOnline; + } + + /** + * Get the apiRevisionDescription property: Description of the Api Revision. + * + * @return the apiRevisionDescription value. + */ + public String apiRevisionDescription() { + return this.apiRevisionDescription; + } + + /** + * Set the apiRevisionDescription property: Description of the Api Revision. + * + * @param apiRevisionDescription the apiRevisionDescription value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withApiRevisionDescription(String apiRevisionDescription) { + this.apiRevisionDescription = apiRevisionDescription; + return this; + } + + /** + * Get the apiVersionDescription property: Description of the Api Version. + * + * @return the apiVersionDescription value. + */ + public String apiVersionDescription() { + return this.apiVersionDescription; + } + + /** + * Set the apiVersionDescription property: Description of the Api Version. + * + * @param apiVersionDescription the apiVersionDescription value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withApiVersionDescription(String apiVersionDescription) { + this.apiVersionDescription = apiVersionDescription; + return this; + } + + /** + * Get the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @return the apiVersionSetId value. + */ + public String apiVersionSetId() { + return this.apiVersionSetId; + } + + /** + * Set the apiVersionSetId property: A resource identifier for the related ApiVersionSet. + * + * @param apiVersionSetId the apiVersionSetId value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withApiVersionSetId(String apiVersionSetId) { + this.apiVersionSetId = apiVersionSetId; + return this; + } + + /** + * Get the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Specifies whether an API or Product subscription is required for accessing + * the API. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Get the displayName property: API name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: API name. + * + * @param displayName the displayName value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the serviceUrl property: Absolute URL of the backend service implementing this API. + * + * @return the serviceUrl value. + */ + public String serviceUrl() { + return this.serviceUrl; + } + + /** + * Set the serviceUrl property: Absolute URL of the backend service implementing this API. + * + * @param serviceUrl the serviceUrl value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withServiceUrl(String serviceUrl) { + this.serviceUrl = serviceUrl; + return this; + } + + /** + * Get the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Relative URL uniquely identifying this API and all of its resource paths within the API + * Management service instance. It is appended to the API endpoint base URL specified during the service instance + * creation to form a public URL for this API. + * + * @param path the path value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Describes on which protocols the operations in this API can be invoked. + * + * @param protocols the protocols value to set. + * @return the ApiUpdateContract object itself. + */ + public ApiUpdateContract withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationSettings() != null) { + authenticationSettings().validate(); + } + if (subscriptionKeyParameterNames() != null) { + subscriptionKeyParameterNames().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionConstraint.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionConstraint.java new file mode 100644 index 0000000000000..5801d2690ce7f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionConstraint.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Control Plane Apis version constraint for the API Management service. */ +@Fluent +public final class ApiVersionConstraint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionConstraint.class); + + /* + * Limit control plane API calls to API Management service with version + * equal to or newer than this value. + */ + @JsonProperty(value = "minApiVersion") + private String minApiVersion; + + /** + * Get the minApiVersion property: Limit control plane API calls to API Management service with version equal to or + * newer than this value. + * + * @return the minApiVersion value. + */ + public String minApiVersion() { + return this.minApiVersion; + } + + /** + * Set the minApiVersion property: Limit control plane API calls to API Management service with version equal to or + * newer than this value. + * + * @param minApiVersion the minApiVersion value to set. + * @return the ApiVersionConstraint object itself. + */ + public ApiVersionConstraint withMinApiVersion(String minApiVersion) { + this.minApiVersion = minApiVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetCollection.java new file mode 100644 index 0000000000000..496f04c366e0e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Api Version Set list representation. */ +@Fluent +public final class ApiVersionSetCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the ApiVersionSetCollection object itself. + */ + public ApiVersionSetCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the ApiVersionSetCollection object itself. + */ + public ApiVersionSetCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the ApiVersionSetCollection object itself. + */ + public ApiVersionSetCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContract.java new file mode 100644 index 0000000000000..f65239c9754c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContract.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; + +/** An immutable client-side representation of ApiVersionSetContract. */ +public interface ApiVersionSetContract { + /** + * 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 description property: Description of API Version Set. + * + * @return the description value. + */ + String description(); + + /** + * Gets the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @return the versionQueryName value. + */ + String versionQueryName(); + + /** + * Gets the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @return the versionHeaderName value. + */ + String versionHeaderName(); + + /** + * Gets the displayName property: Name of API Version Set. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the versioningScheme property: An value that determines where the API Version identifier will be located in + * a HTTP request. + * + * @return the versioningScheme value. + */ + VersioningScheme versioningScheme(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner object. + * + * @return the inner object. + */ + ApiVersionSetContractInner innerModel(); + + /** The entirety of the ApiVersionSetContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ApiVersionSetContract definition stages. */ + interface DefinitionStages { + /** The first stage of the ApiVersionSetContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ApiVersionSetContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the ApiVersionSetContract 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.WithDescription, + DefinitionStages.WithVersionQueryName, + DefinitionStages.WithVersionHeaderName, + DefinitionStages.WithDisplayName, + DefinitionStages.WithVersioningScheme, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiVersionSetContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiVersionSetContract create(Context context); + } + /** The stage of the ApiVersionSetContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of API Version Set.. + * + * @param description Description of API Version Set. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ApiVersionSetContract definition allowing to specify versionQueryName. */ + interface WithVersionQueryName { + /** + * Specifies the versionQueryName property: Name of query parameter that indicates the API Version if + * versioningScheme is set to `query`.. + * + * @param versionQueryName Name of query parameter that indicates the API Version if versioningScheme is set + * to `query`. + * @return the next definition stage. + */ + WithCreate withVersionQueryName(String versionQueryName); + } + /** The stage of the ApiVersionSetContract definition allowing to specify versionHeaderName. */ + interface WithVersionHeaderName { + /** + * Specifies the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`.. + * + * @param versionHeaderName Name of HTTP header parameter that indicates the API Version if versioningScheme + * is set to `header`. + * @return the next definition stage. + */ + WithCreate withVersionHeaderName(String versionHeaderName); + } + /** The stage of the ApiVersionSetContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Name of API Version Set. + * + * @param displayName Name of API Version Set. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the ApiVersionSetContract definition allowing to specify versioningScheme. */ + interface WithVersioningScheme { + /** + * Specifies the versioningScheme property: An value that determines where the API Version identifier will + * be located in a HTTP request.. + * + * @param versioningScheme An value that determines where the API Version identifier will be located in a + * HTTP request. + * @return the next definition stage. + */ + WithCreate withVersioningScheme(VersioningScheme versioningScheme); + } + /** The stage of the ApiVersionSetContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the ApiVersionSetContract resource. + * + * @return the stage of resource update. + */ + ApiVersionSetContract.Update update(); + + /** The template for ApiVersionSetContract update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithVersionQueryName, + UpdateStages.WithVersionHeaderName, + UpdateStages.WithDisplayName, + UpdateStages.WithVersioningScheme, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiVersionSetContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiVersionSetContract apply(Context context); + } + /** The ApiVersionSetContract update stages. */ + interface UpdateStages { + /** The stage of the ApiVersionSetContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of API Version Set.. + * + * @param description Description of API Version Set. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the ApiVersionSetContract update allowing to specify versionQueryName. */ + interface WithVersionQueryName { + /** + * Specifies the versionQueryName property: Name of query parameter that indicates the API Version if + * versioningScheme is set to `query`.. + * + * @param versionQueryName Name of query parameter that indicates the API Version if versioningScheme is set + * to `query`. + * @return the next definition stage. + */ + Update withVersionQueryName(String versionQueryName); + } + /** The stage of the ApiVersionSetContract update allowing to specify versionHeaderName. */ + interface WithVersionHeaderName { + /** + * Specifies the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`.. + * + * @param versionHeaderName Name of HTTP header parameter that indicates the API Version if versioningScheme + * is set to `header`. + * @return the next definition stage. + */ + Update withVersionHeaderName(String versionHeaderName); + } + /** The stage of the ApiVersionSetContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Name of API Version Set. + * + * @param displayName Name of API Version Set. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the ApiVersionSetContract update allowing to specify versioningScheme. */ + interface WithVersioningScheme { + /** + * Specifies the versioningScheme property: An value that determines where the API Version identifier will + * be located in a HTTP request.. + * + * @param versioningScheme An value that determines where the API Version identifier will be located in a + * HTTP request. + * @return the next definition stage. + */ + Update withVersioningScheme(VersioningScheme versioningScheme); + } + /** The stage of the ApiVersionSetContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiVersionSetContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiVersionSetContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetails.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetails.java new file mode 100644 index 0000000000000..eb854196aff97 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetails.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 API Version Set contains the common configuration for a set of API Versions relating. */ +@Fluent +public final class ApiVersionSetContractDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetContractDetails.class); + + /* + * Identifier for existing API Version Set. Omit this value to create a new + * Version Set. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The display Name of the API Version Set. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Description of API Version Set. + */ + @JsonProperty(value = "description") + private String description; + + /* + * An value that determines where the API Version identifier will be + * located in a HTTP request. + */ + @JsonProperty(value = "versioningScheme") + private ApiVersionSetContractDetailsVersioningScheme versioningScheme; + + /* + * Name of query parameter that indicates the API Version if + * versioningScheme is set to `query`. + */ + @JsonProperty(value = "versionQueryName") + private String versionQueryName; + + /* + * Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + */ + @JsonProperty(value = "versionHeaderName") + private String versionHeaderName; + + /** + * Get the id property: Identifier for existing API Version Set. Omit this value to create a new Version Set. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Identifier for existing API Version Set. Omit this value to create a new Version Set. + * + * @param id the id value to set. + * @return the ApiVersionSetContractDetails object itself. + */ + public ApiVersionSetContractDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The display Name of the API Version Set. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The display Name of the API Version Set. + * + * @param name the name value to set. + * @return the ApiVersionSetContractDetails object itself. + */ + public ApiVersionSetContractDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description of API Version Set. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of API Version Set. + * + * @param description the description value to set. + * @return the ApiVersionSetContractDetails object itself. + */ + public ApiVersionSetContractDetails withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @return the versioningScheme value. + */ + public ApiVersionSetContractDetailsVersioningScheme versioningScheme() { + return this.versioningScheme; + } + + /** + * Set the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @param versioningScheme the versioningScheme value to set. + * @return the ApiVersionSetContractDetails object itself. + */ + public ApiVersionSetContractDetails withVersioningScheme( + ApiVersionSetContractDetailsVersioningScheme versioningScheme) { + this.versioningScheme = versioningScheme; + return this; + } + + /** + * Get the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @return the versionQueryName value. + */ + public String versionQueryName() { + return this.versionQueryName; + } + + /** + * Set the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @param versionQueryName the versionQueryName value to set. + * @return the ApiVersionSetContractDetails object itself. + */ + public ApiVersionSetContractDetails withVersionQueryName(String versionQueryName) { + this.versionQueryName = versionQueryName; + return this; + } + + /** + * Get the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @return the versionHeaderName value. + */ + public String versionHeaderName() { + return this.versionHeaderName; + } + + /** + * Set the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @param versionHeaderName the versionHeaderName value to set. + * @return the ApiVersionSetContractDetails object itself. + */ + public ApiVersionSetContractDetails withVersionHeaderName(String versionHeaderName) { + this.versionHeaderName = versionHeaderName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetailsVersioningScheme.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetailsVersioningScheme.java new file mode 100644 index 0000000000000..f816e89a35e24 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractDetailsVersioningScheme.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApiVersionSetContractDetailsVersioningScheme. */ +public final class ApiVersionSetContractDetailsVersioningScheme + extends ExpandableStringEnum { + /** Static value Segment for ApiVersionSetContractDetailsVersioningScheme. */ + public static final ApiVersionSetContractDetailsVersioningScheme SEGMENT = fromString("Segment"); + + /** Static value Query for ApiVersionSetContractDetailsVersioningScheme. */ + public static final ApiVersionSetContractDetailsVersioningScheme QUERY = fromString("Query"); + + /** Static value Header for ApiVersionSetContractDetailsVersioningScheme. */ + public static final ApiVersionSetContractDetailsVersioningScheme HEADER = fromString("Header"); + + /** + * Creates or finds a ApiVersionSetContractDetailsVersioningScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApiVersionSetContractDetailsVersioningScheme. + */ + @JsonCreator + public static ApiVersionSetContractDetailsVersioningScheme fromString(String name) { + return fromString(name, ApiVersionSetContractDetailsVersioningScheme.class); + } + + /** @return known ApiVersionSetContractDetailsVersioningScheme values. */ + public static Collection values() { + return values(ApiVersionSetContractDetailsVersioningScheme.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractProperties.java new file mode 100644 index 0000000000000..de03fbb17e7e7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetContractProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Properties of an API Version Set. */ +@Fluent +public final class ApiVersionSetContractProperties extends ApiVersionSetEntityBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetContractProperties.class); + + /* + * Name of API Version Set + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * An value that determines where the API Version identifier will be + * located in a HTTP request. + */ + @JsonProperty(value = "versioningScheme", required = true) + private VersioningScheme versioningScheme; + + /** + * Get the displayName property: Name of API Version Set. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Name of API Version Set. + * + * @param displayName the displayName value to set. + * @return the ApiVersionSetContractProperties object itself. + */ + public ApiVersionSetContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @return the versioningScheme value. + */ + public VersioningScheme versioningScheme() { + return this.versioningScheme; + } + + /** + * Set the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @param versioningScheme the versioningScheme value to set. + * @return the ApiVersionSetContractProperties object itself. + */ + public ApiVersionSetContractProperties withVersioningScheme(VersioningScheme versioningScheme) { + this.versioningScheme = versioningScheme; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiVersionSetContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiVersionSetContractProperties withVersionQueryName(String versionQueryName) { + super.withVersionQueryName(versionQueryName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiVersionSetContractProperties withVersionHeaderName(String versionHeaderName) { + super.withVersionHeaderName(versionHeaderName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model ApiVersionSetContractProperties")); + } + if (versioningScheme() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property versioningScheme in model ApiVersionSetContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetEntityBase.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetEntityBase.java new file mode 100644 index 0000000000000..8f03cca13ad53 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetEntityBase.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Api Version set base parameters. */ +@Fluent +public class ApiVersionSetEntityBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetEntityBase.class); + + /* + * Description of API Version Set. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Name of query parameter that indicates the API Version if + * versioningScheme is set to `query`. + */ + @JsonProperty(value = "versionQueryName") + private String versionQueryName; + + /* + * Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + */ + @JsonProperty(value = "versionHeaderName") + private String versionHeaderName; + + /** + * Get the description property: Description of API Version Set. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of API Version Set. + * + * @param description the description value to set. + * @return the ApiVersionSetEntityBase object itself. + */ + public ApiVersionSetEntityBase withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @return the versionQueryName value. + */ + public String versionQueryName() { + return this.versionQueryName; + } + + /** + * Set the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @param versionQueryName the versionQueryName value to set. + * @return the ApiVersionSetEntityBase object itself. + */ + public ApiVersionSetEntityBase withVersionQueryName(String versionQueryName) { + this.versionQueryName = versionQueryName; + return this; + } + + /** + * Get the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @return the versionHeaderName value. + */ + public String versionHeaderName() { + return this.versionHeaderName; + } + + /** + * Set the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @param versionHeaderName the versionHeaderName value to set. + * @return the ApiVersionSetEntityBase object itself. + */ + public ApiVersionSetEntityBase withVersionHeaderName(String versionHeaderName) { + this.versionHeaderName = versionHeaderName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParameters.java new file mode 100644 index 0000000000000..2c7a683c8a68d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParameters.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters to update or create an Api Version Set Contract. */ +@JsonFlatten +@Fluent +public class ApiVersionSetUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetUpdateParameters.class); + + /* + * Description of API Version Set. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Name of query parameter that indicates the API Version if + * versioningScheme is set to `query`. + */ + @JsonProperty(value = "properties.versionQueryName") + private String versionQueryName; + + /* + * Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + */ + @JsonProperty(value = "properties.versionHeaderName") + private String versionHeaderName; + + /* + * Name of API Version Set + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * An value that determines where the API Version identifier will be + * located in a HTTP request. + */ + @JsonProperty(value = "properties.versioningScheme") + private VersioningScheme versioningScheme; + + /** + * Get the description property: Description of API Version Set. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of API Version Set. + * + * @param description the description value to set. + * @return the ApiVersionSetUpdateParameters object itself. + */ + public ApiVersionSetUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @return the versionQueryName value. + */ + public String versionQueryName() { + return this.versionQueryName; + } + + /** + * Set the versionQueryName property: Name of query parameter that indicates the API Version if versioningScheme is + * set to `query`. + * + * @param versionQueryName the versionQueryName value to set. + * @return the ApiVersionSetUpdateParameters object itself. + */ + public ApiVersionSetUpdateParameters withVersionQueryName(String versionQueryName) { + this.versionQueryName = versionQueryName; + return this; + } + + /** + * Get the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @return the versionHeaderName value. + */ + public String versionHeaderName() { + return this.versionHeaderName; + } + + /** + * Set the versionHeaderName property: Name of HTTP header parameter that indicates the API Version if + * versioningScheme is set to `header`. + * + * @param versionHeaderName the versionHeaderName value to set. + * @return the ApiVersionSetUpdateParameters object itself. + */ + public ApiVersionSetUpdateParameters withVersionHeaderName(String versionHeaderName) { + this.versionHeaderName = versionHeaderName; + return this; + } + + /** + * Get the displayName property: Name of API Version Set. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Name of API Version Set. + * + * @param displayName the displayName value to set. + * @return the ApiVersionSetUpdateParameters object itself. + */ + public ApiVersionSetUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @return the versioningScheme value. + */ + public VersioningScheme versioningScheme() { + return this.versioningScheme; + } + + /** + * Set the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @param versioningScheme the versioningScheme value to set. + * @return the ApiVersionSetUpdateParameters object itself. + */ + public ApiVersionSetUpdateParameters withVersioningScheme(VersioningScheme versioningScheme) { + this.versioningScheme = versioningScheme; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParametersProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParametersProperties.java new file mode 100644 index 0000000000000..255dab5144c30 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetUpdateParametersProperties.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.apimanagement.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; + +/** Properties used to create or update an API Version Set. */ +@Fluent +public final class ApiVersionSetUpdateParametersProperties extends ApiVersionSetEntityBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetUpdateParametersProperties.class); + + /* + * Name of API Version Set + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * An value that determines where the API Version identifier will be + * located in a HTTP request. + */ + @JsonProperty(value = "versioningScheme") + private VersioningScheme versioningScheme; + + /** + * Get the displayName property: Name of API Version Set. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Name of API Version Set. + * + * @param displayName the displayName value to set. + * @return the ApiVersionSetUpdateParametersProperties object itself. + */ + public ApiVersionSetUpdateParametersProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @return the versioningScheme value. + */ + public VersioningScheme versioningScheme() { + return this.versioningScheme; + } + + /** + * Set the versioningScheme property: An value that determines where the API Version identifier will be located in a + * HTTP request. + * + * @param versioningScheme the versioningScheme value to set. + * @return the ApiVersionSetUpdateParametersProperties object itself. + */ + public ApiVersionSetUpdateParametersProperties withVersioningScheme(VersioningScheme versioningScheme) { + this.versioningScheme = versioningScheme; + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiVersionSetUpdateParametersProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiVersionSetUpdateParametersProperties withVersionQueryName(String versionQueryName) { + super.withVersionQueryName(versionQueryName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApiVersionSetUpdateParametersProperties withVersionHeaderName(String versionHeaderName) { + super.withVersionHeaderName(versionHeaderName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSets.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSets.java new file mode 100644 index 0000000000000..fba2adf654cfc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSets.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.apimanagement.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 ApiVersionSets. */ +public interface ApiVersionSets { + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of API Version Sets in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api Version Set list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String versionSetId); + + /** + * Gets the entity state (Etag) version of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Api Version Set specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context); + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + ApiVersionSetContract get(String resourceGroupName, String serviceName, String versionSetId); + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String versionSetId, Context context); + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String versionSetId, String ifMatch); + + /** + * Deletes specific Api Version Set. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param versionSetId Api Version Set identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String versionSetId, String ifMatch, Context context); + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + ApiVersionSetContract getById(String id); + + /** + * Gets the details of the Api Version Set specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Api Version Set specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific Api Version Set. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes specific Api Version Set. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new ApiVersionSetContract resource. + * + * @param name resource name. + * @return the first stage of the new ApiVersionSetContract definition. + */ + ApiVersionSetContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..3a046cd102c32 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateHeaders.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.apimanagement.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 ApiVersionSetsCreateOrUpdateHeaders model. */ +@Fluent +public final class ApiVersionSetsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiVersionSetsCreateOrUpdateHeaders object itself. + */ + public ApiVersionSetsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..f9fa4f072e5ba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApiVersionSetsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiVersionSetsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiVersionSetsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiVersionSetsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiVersionSetContractInner value, + ApiVersionSetsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiVersionSetContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..b7319e2e6dafc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagHeaders.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.apimanagement.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 ApiVersionSetsGetEntityTagHeaders model. */ +@Fluent +public final class ApiVersionSetsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiVersionSetsGetEntityTagHeaders object itself. + */ + public ApiVersionSetsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagResponse.java new file mode 100644 index 0000000000000..4a7b9e413c08a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApiVersionSetsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApiVersionSetsGetEntityTagResponse. + * + * @param request the request which resulted in this ApiVersionSetsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiVersionSetsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ApiVersionSetsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetHeaders.java new file mode 100644 index 0000000000000..425cae00a2b16 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetHeaders.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.apimanagement.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 ApiVersionSetsGetHeaders model. */ +@Fluent +public final class ApiVersionSetsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiVersionSetsGetHeaders object itself. + */ + public ApiVersionSetsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetResponse.java new file mode 100644 index 0000000000000..f509b23a0415b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; + +/** Contains all response data for the get operation. */ +public final class ApiVersionSetsGetResponse + extends ResponseBase { + /** + * Creates an instance of ApiVersionSetsGetResponse. + * + * @param request the request which resulted in this ApiVersionSetsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiVersionSetsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiVersionSetContractInner value, + ApiVersionSetsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiVersionSetContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateHeaders.java new file mode 100644 index 0000000000000..19427a8d845cc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateHeaders.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.apimanagement.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 ApiVersionSetsUpdateHeaders model. */ +@Fluent +public final class ApiVersionSetsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiVersionSetsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApiVersionSetsUpdateHeaders object itself. + */ + public ApiVersionSetsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateResponse.java new file mode 100644 index 0000000000000..24db18c2165f0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApiVersionSetsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiVersionSetContractInner; + +/** Contains all response data for the update operation. */ +public final class ApiVersionSetsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiVersionSetsUpdateResponse. + * + * @param request the request which resulted in this ApiVersionSetsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApiVersionSetsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiVersionSetContractInner value, + ApiVersionSetsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiVersionSetContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimIdentityType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimIdentityType.java new file mode 100644 index 0000000000000..1d17ffe4cfcb2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimIdentityType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApimIdentityType. */ +public final class ApimIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for ApimIdentityType. */ + public static final ApimIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ApimIdentityType. */ + public static final ApimIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ApimIdentityType. */ + public static final ApimIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); + + /** Static value None for ApimIdentityType. */ + public static final ApimIdentityType NONE = fromString("None"); + + /** + * Creates or finds a ApimIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApimIdentityType. + */ + @JsonCreator + public static ApimIdentityType fromString(String name) { + return fromString(name, ApimIdentityType.class); + } + + /** @return known ApimIdentityType values. */ + public static Collection values() { + return values(ApimIdentityType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimResource.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimResource.java new file mode 100644 index 0000000000000..dec81dcd775e1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApimResource.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Resource definition. */ +@Fluent +public class ApimResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApimResource.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 ApimResource object itself. + */ + public ApimResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Apis.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Apis.java new file mode 100644 index 0000000000000..6d79636b22af2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Apis.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Apis. */ +public interface Apis { + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists all APIs of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq, ne | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param tags Include tags in the response. + * @param expandApiVersionSet Include full ApiVersionSet resource in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String tags, + Boolean expandApiVersionSet, + Context context); + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String apiId); + + /** + * Gets the entity state (Etag) version of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the API specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + ApiContract get(String resourceGroupName, String serviceName, String apiId); + + /** + * Gets the details of the API specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + Response getWithResponse(String resourceGroupName, String serviceName, String apiId, Context context); + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiId, String ifMatch); + + /** + * Deletes the specified API of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String apiId, + String ifMatch, + Boolean deleteRevisions, + Context context); + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByTags(String resourceGroupName, String serviceName); + + /** + * Lists a collection of apis associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| isCurrent | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedApis Include not tagged APIs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedApis, + Context context); + + /** + * Gets the details of the API specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + ApiContract getById(String id); + + /** + * Gets the details of the API specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the API specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified API of the API Management service instance. + * + * @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 the specified API of the API Management service instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteRevisions Delete all revisions of the Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Boolean deleteRevisions, Context context); + + /** + * Begins definition for a new ApiContract resource. + * + * @param name resource name. + * @return the first stage of the new ApiContract definition. + */ + ApiContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..6b3d00bbcdabd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateHeaders.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.apimanagement.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 ApisCreateOrUpdateHeaders model. */ +@Fluent +public final class ApisCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApisCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApisCreateOrUpdateHeaders object itself. + */ + public ApisCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..5786e05f27747 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ApisCreateOrUpdateResponse extends ResponseBase { + /** + * Creates an instance of ApisCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApisCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApisCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiContractInner value, + ApisCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagHeaders.java new file mode 100644 index 0000000000000..e884bb1b4ac67 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagHeaders.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.apimanagement.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 ApisGetEntityTagHeaders model. */ +@Fluent +public final class ApisGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApisGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApisGetEntityTagHeaders object itself. + */ + public ApisGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagResponse.java new file mode 100644 index 0000000000000..c7e84b0013cdb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ApisGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ApisGetEntityTagResponse. + * + * @param request the request which resulted in this ApisGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApisGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, ApisGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetHeaders.java new file mode 100644 index 0000000000000..877feeef0d42f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetHeaders.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.apimanagement.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 ApisGetHeaders model. */ +@Fluent +public final class ApisGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApisGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApisGetHeaders object itself. + */ + public ApisGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetResponse.java new file mode 100644 index 0000000000000..b7da1a02566b0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisGetResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; + +/** Contains all response data for the get operation. */ +public final class ApisGetResponse extends ResponseBase { + /** + * Creates an instance of ApisGetResponse. + * + * @param request the request which resulted in this ApisGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApisGetResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, ApiContractInner value, ApisGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateHeaders.java new file mode 100644 index 0000000000000..f0d0ea4b75fdd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateHeaders.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.apimanagement.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 ApisUpdateHeaders model. */ +@Fluent +public final class ApisUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApisUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ApisUpdateHeaders object itself. + */ + public ApisUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateResponse.java new file mode 100644 index 0000000000000..548363897cb11 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ApisUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ApiContractInner; + +/** Contains all response data for the update operation. */ +public final class ApisUpdateResponse extends ResponseBase { + /** + * Creates an instance of ApisUpdateResponse. + * + * @param request the request which resulted in this ApisUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApisUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ApiContractInner value, + ApisUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ApiContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AppType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AppType.java new file mode 100644 index 0000000000000..0a20df361e2c5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AppType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AppType. */ +public final class AppType extends ExpandableStringEnum { + /** Static value portal for AppType. */ + public static final AppType PORTAL = fromString("portal"); + + /** Static value developerPortal for AppType. */ + public static final AppType DEVELOPER_PORTAL = fromString("developerPortal"); + + /** + * Creates or finds a AppType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppType. + */ + @JsonCreator + public static AppType fromString(String name) { + return fromString(name, AppType.class); + } + + /** @return known AppType values. */ + public static Collection values() { + return values(AppType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AssociationContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AssociationContract.java new file mode 100644 index 0000000000000..df5b885cb93a7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AssociationContract.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Association entity details. */ +@JsonFlatten +@Fluent +public class AssociationContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AssociationContract.class); + + /* + * Provisioning state. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state. + * + * @param provisioningState the provisioningState value to set. + * @return the AssociationContract object itself. + */ + public AssociationContract withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AsyncOperationStatus.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AsyncOperationStatus.java new file mode 100644 index 0000000000000..834f57a4840b6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AsyncOperationStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AsyncOperationStatus. */ +public enum AsyncOperationStatus { + /** Enum value Started. */ + STARTED("Started"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationStatus instance. */ + private final String value; + + AsyncOperationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationStatus object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationStatus fromString(String value) { + AsyncOperationStatus[] items = AsyncOperationStatus.values(); + for (AsyncOperationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthenticationSettingsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthenticationSettingsContract.java new file mode 100644 index 0000000000000..b196261e895b8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthenticationSettingsContract.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.apimanagement.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; + +/** API Authentication Settings. */ +@Fluent +public final class AuthenticationSettingsContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthenticationSettingsContract.class); + + /* + * OAuth2 Authentication settings + */ + @JsonProperty(value = "oAuth2") + private OAuth2AuthenticationSettingsContract oAuth2; + + /* + * OpenID Connect Authentication Settings + */ + @JsonProperty(value = "openid") + private OpenIdAuthenticationSettingsContract openid; + + /** + * Get the oAuth2 property: OAuth2 Authentication settings. + * + * @return the oAuth2 value. + */ + public OAuth2AuthenticationSettingsContract oAuth2() { + return this.oAuth2; + } + + /** + * Set the oAuth2 property: OAuth2 Authentication settings. + * + * @param oAuth2 the oAuth2 value to set. + * @return the AuthenticationSettingsContract object itself. + */ + public AuthenticationSettingsContract withOAuth2(OAuth2AuthenticationSettingsContract oAuth2) { + this.oAuth2 = oAuth2; + return this; + } + + /** + * Get the openid property: OpenID Connect Authentication Settings. + * + * @return the openid value. + */ + public OpenIdAuthenticationSettingsContract openid() { + return this.openid; + } + + /** + * Set the openid property: OpenID Connect Authentication Settings. + * + * @param openid the openid value to set. + * @return the AuthenticationSettingsContract object itself. + */ + public AuthenticationSettingsContract withOpenid(OpenIdAuthenticationSettingsContract openid) { + this.openid = openid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (oAuth2() != null) { + oAuth2().validate(); + } + if (openid() != null) { + openid().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationMethod.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationMethod.java new file mode 100644 index 0000000000000..da539b9f7adb9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationMethod.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AuthorizationMethod. */ +public enum AuthorizationMethod { + /** Enum value HEAD. */ + HEAD("HEAD"), + + /** Enum value OPTIONS. */ + OPTIONS("OPTIONS"), + + /** Enum value TRACE. */ + TRACE("TRACE"), + + /** Enum value GET. */ + GET("GET"), + + /** Enum value POST. */ + POST("POST"), + + /** Enum value PUT. */ + PUT("PUT"), + + /** Enum value PATCH. */ + PATCH("PATCH"), + + /** Enum value DELETE. */ + DELETE("DELETE"); + + /** The actual serialized value for a AuthorizationMethod instance. */ + private final String value; + + AuthorizationMethod(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AuthorizationMethod instance. + * + * @param value the serialized value to parse. + * @return the parsed AuthorizationMethod object, or null if unable to parse. + */ + @JsonCreator + public static AuthorizationMethod fromString(String value) { + AuthorizationMethod[] items = AuthorizationMethod.values(); + for (AuthorizationMethod item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerCollection.java new file mode 100644 index 0000000000000..d439a5d655eb3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged OAuth2 Authorization Servers list representation. */ +@Fluent +public final class AuthorizationServerCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the AuthorizationServerCollection object itself. + */ + public AuthorizationServerCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the AuthorizationServerCollection object itself. + */ + public AuthorizationServerCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the AuthorizationServerCollection object itself. + */ + public AuthorizationServerCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContract.java new file mode 100644 index 0000000000000..53695c795b768 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContract.java @@ -0,0 +1,710 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; +import java.util.List; + +/** An immutable client-side representation of AuthorizationServerContract. */ +public interface AuthorizationServerContract { + /** + * 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 description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @return the description value. + */ + String description(); + + /** + * Gets the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @return the authorizationMethods value. + */ + List authorizationMethods(); + + /** + * Gets the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @return the clientAuthenticationMethod value. + */ + List clientAuthenticationMethod(); + + /** + * Gets the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @return the tokenBodyParameters value. + */ + List tokenBodyParameters(); + + /** + * Gets the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @return the tokenEndpoint value. + */ + String tokenEndpoint(); + + /** + * Gets the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @return the supportState value. + */ + Boolean supportState(); + + /** + * Gets the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @return the defaultScope value. + */ + String defaultScope(); + + /** + * Gets the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @return the bearerTokenSendingMethods value. + */ + List bearerTokenSendingMethods(); + + /** + * Gets the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @return the resourceOwnerUsername value. + */ + String resourceOwnerUsername(); + + /** + * Gets the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @return the resourceOwnerPassword value. + */ + String resourceOwnerPassword(); + + /** + * Gets the displayName property: User-friendly authorization server name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @return the clientRegistrationEndpoint value. + */ + String clientRegistrationEndpoint(); + + /** + * Gets the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @return the authorizationEndpoint value. + */ + String authorizationEndpoint(); + + /** + * Gets the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @return the grantTypes value. + */ + List grantTypes(); + + /** + * Gets the clientId property: Client or app id registered with this authorization server. + * + * @return the clientId value. + */ + String clientId(); + + /** + * Gets the clientSecret property: Client or app secret registered with this authorization server. This property + * will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @return the clientSecret value. + */ + String clientSecret(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner object. + * + * @return the inner object. + */ + AuthorizationServerContractInner innerModel(); + + /** The entirety of the AuthorizationServerContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AuthorizationServerContract definition stages. */ + interface DefinitionStages { + /** The first stage of the AuthorizationServerContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AuthorizationServerContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the AuthorizationServerContract 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.WithDescription, + DefinitionStages.WithAuthorizationMethods, + DefinitionStages.WithClientAuthenticationMethod, + DefinitionStages.WithTokenBodyParameters, + DefinitionStages.WithTokenEndpoint, + DefinitionStages.WithSupportState, + DefinitionStages.WithDefaultScope, + DefinitionStages.WithBearerTokenSendingMethods, + DefinitionStages.WithResourceOwnerUsername, + DefinitionStages.WithResourceOwnerPassword, + DefinitionStages.WithDisplayName, + DefinitionStages.WithClientRegistrationEndpoint, + DefinitionStages.WithAuthorizationEndpoint, + DefinitionStages.WithGrantTypes, + DefinitionStages.WithClientId, + DefinitionStages.WithClientSecret, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + AuthorizationServerContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AuthorizationServerContract create(Context context); + } + /** The stage of the AuthorizationServerContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the authorization server. Can contain HTML formatting + * tags.. + * + * @param description Description of the authorization server. Can contain HTML formatting tags. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the AuthorizationServerContract definition allowing to specify authorizationMethods. */ + interface WithAuthorizationMethods { + /** + * Specifies the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must + * be always present. POST is optional.. + * + * @param authorizationMethods HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * @return the next definition stage. + */ + WithCreate withAuthorizationMethods(List authorizationMethods); + } + /** The stage of the AuthorizationServerContract definition allowing to specify clientAuthenticationMethod. */ + interface WithClientAuthenticationMethod { + /** + * Specifies the clientAuthenticationMethod property: Method of authentication supported by the token + * endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, + * client credentials and other parameters are passed within the request body in the + * application/x-www-form-urlencoded format.. + * + * @param clientAuthenticationMethod Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client + * credentials and other parameters are passed within the request body in the + * application/x-www-form-urlencoded format. + * @return the next definition stage. + */ + WithCreate withClientAuthenticationMethod(List clientAuthenticationMethod); + } + /** The stage of the AuthorizationServerContract definition allowing to specify tokenBodyParameters. */ + interface WithTokenBodyParameters { + /** + * Specifies the tokenBodyParameters property: Additional parameters required by the token endpoint of this + * authorization server represented as an array of JSON objects with name and value string properties, i.e. + * {"name" : "name value", "value": "a value"}.. + * + * @param tokenBodyParameters Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : + * "name value", "value": "a value"}. + * @return the next definition stage. + */ + WithCreate withTokenBodyParameters(List tokenBodyParameters); + } + /** The stage of the AuthorizationServerContract definition allowing to specify tokenEndpoint. */ + interface WithTokenEndpoint { + /** + * Specifies the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being + * referenced.. + * + * @param tokenEndpoint OAuth token endpoint. Contains absolute URI to entity being referenced. + * @return the next definition stage. + */ + WithCreate withTokenEndpoint(String tokenEndpoint); + } + /** The stage of the AuthorizationServerContract definition allowing to specify supportState. */ + interface WithSupportState { + /** + * Specifies the supportState property: If true, authorization server will include state parameter from the + * authorization request to its response. Client may use state parameter to raise protocol security.. + * + * @param supportState If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * @return the next definition stage. + */ + WithCreate withSupportState(Boolean supportState); + } + /** The stage of the AuthorizationServerContract definition allowing to specify defaultScope. */ + interface WithDefaultScope { + /** + * Specifies the defaultScope property: Access token scope that is going to be requested by default. Can be + * overridden at the API level. Should be provided in the form of a string containing space-delimited + * values.. + * + * @param defaultScope Access token scope that is going to be requested by default. Can be overridden at the + * API level. Should be provided in the form of a string containing space-delimited values. + * @return the next definition stage. + */ + WithCreate withDefaultScope(String defaultScope); + } + /** The stage of the AuthorizationServerContract definition allowing to specify bearerTokenSendingMethods. */ + interface WithBearerTokenSendingMethods { + /** + * Specifies the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed + * to the API. . + * + * @param bearerTokenSendingMethods Specifies the mechanism by which access token is passed to the API. + * @return the next definition stage. + */ + WithCreate withBearerTokenSendingMethods(List bearerTokenSendingMethods); + } + /** The stage of the AuthorizationServerContract definition allowing to specify resourceOwnerUsername. */ + interface WithResourceOwnerUsername { + /** + * Specifies the resourceOwnerUsername property: Can be optionally specified when resource owner password + * grant type is supported by this authorization server. Default resource owner username.. + * + * @param resourceOwnerUsername Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * @return the next definition stage. + */ + WithCreate withResourceOwnerUsername(String resourceOwnerUsername); + } + /** The stage of the AuthorizationServerContract definition allowing to specify resourceOwnerPassword. */ + interface WithResourceOwnerPassword { + /** + * Specifies the resourceOwnerPassword property: Can be optionally specified when resource owner password + * grant type is supported by this authorization server. Default resource owner password.. + * + * @param resourceOwnerPassword Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * @return the next definition stage. + */ + WithCreate withResourceOwnerPassword(String resourceOwnerPassword); + } + /** The stage of the AuthorizationServerContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: User-friendly authorization server name.. + * + * @param displayName User-friendly authorization server name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the AuthorizationServerContract definition allowing to specify clientRegistrationEndpoint. */ + interface WithClientRegistrationEndpoint { + /** + * Specifies the clientRegistrationEndpoint property: Optional reference to a page where client or app + * registration for this authorization server is performed. Contains absolute URL to entity being + * referenced.. + * + * @param clientRegistrationEndpoint Optional reference to a page where client or app registration for this + * authorization server is performed. Contains absolute URL to entity being referenced. + * @return the next definition stage. + */ + WithCreate withClientRegistrationEndpoint(String clientRegistrationEndpoint); + } + /** The stage of the AuthorizationServerContract definition allowing to specify authorizationEndpoint. */ + interface WithAuthorizationEndpoint { + /** + * Specifies the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2.. + * + * @param authorizationEndpoint OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * @return the next definition stage. + */ + WithCreate withAuthorizationEndpoint(String authorizationEndpoint); + } + /** The stage of the AuthorizationServerContract definition allowing to specify grantTypes. */ + interface WithGrantTypes { + /** + * Specifies the grantTypes property: Form of an authorization grant, which the client uses to request the + * access token.. + * + * @param grantTypes Form of an authorization grant, which the client uses to request the access token. + * @return the next definition stage. + */ + WithCreate withGrantTypes(List grantTypes); + } + /** The stage of the AuthorizationServerContract definition allowing to specify clientId. */ + interface WithClientId { + /** + * Specifies the clientId property: Client or app id registered with this authorization server.. + * + * @param clientId Client or app id registered with this authorization server. + * @return the next definition stage. + */ + WithCreate withClientId(String clientId); + } + /** The stage of the AuthorizationServerContract definition allowing to specify clientSecret. */ + interface WithClientSecret { + /** + * Specifies the clientSecret property: Client or app secret registered with this authorization server. This + * property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.. + * + * @param clientSecret Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * @return the next definition stage. + */ + WithCreate withClientSecret(String clientSecret); + } + /** The stage of the AuthorizationServerContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the AuthorizationServerContract resource. + * + * @return the stage of resource update. + */ + AuthorizationServerContract.Update update(); + + /** The template for AuthorizationServerContract update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithAuthorizationMethods, + UpdateStages.WithClientAuthenticationMethod, + UpdateStages.WithTokenBodyParameters, + UpdateStages.WithTokenEndpoint, + UpdateStages.WithSupportState, + UpdateStages.WithDefaultScope, + UpdateStages.WithBearerTokenSendingMethods, + UpdateStages.WithResourceOwnerUsername, + UpdateStages.WithResourceOwnerPassword, + UpdateStages.WithDisplayName, + UpdateStages.WithClientRegistrationEndpoint, + UpdateStages.WithAuthorizationEndpoint, + UpdateStages.WithGrantTypes, + UpdateStages.WithClientId, + UpdateStages.WithClientSecret, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AuthorizationServerContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AuthorizationServerContract apply(Context context); + } + /** The AuthorizationServerContract update stages. */ + interface UpdateStages { + /** The stage of the AuthorizationServerContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the authorization server. Can contain HTML formatting + * tags.. + * + * @param description Description of the authorization server. Can contain HTML formatting tags. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the AuthorizationServerContract update allowing to specify authorizationMethods. */ + interface WithAuthorizationMethods { + /** + * Specifies the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must + * be always present. POST is optional.. + * + * @param authorizationMethods HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * @return the next definition stage. + */ + Update withAuthorizationMethods(List authorizationMethods); + } + /** The stage of the AuthorizationServerContract update allowing to specify clientAuthenticationMethod. */ + interface WithClientAuthenticationMethod { + /** + * Specifies the clientAuthenticationMethod property: Method of authentication supported by the token + * endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, + * client credentials and other parameters are passed within the request body in the + * application/x-www-form-urlencoded format.. + * + * @param clientAuthenticationMethod Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client + * credentials and other parameters are passed within the request body in the + * application/x-www-form-urlencoded format. + * @return the next definition stage. + */ + Update withClientAuthenticationMethod(List clientAuthenticationMethod); + } + /** The stage of the AuthorizationServerContract update allowing to specify tokenBodyParameters. */ + interface WithTokenBodyParameters { + /** + * Specifies the tokenBodyParameters property: Additional parameters required by the token endpoint of this + * authorization server represented as an array of JSON objects with name and value string properties, i.e. + * {"name" : "name value", "value": "a value"}.. + * + * @param tokenBodyParameters Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : + * "name value", "value": "a value"}. + * @return the next definition stage. + */ + Update withTokenBodyParameters(List tokenBodyParameters); + } + /** The stage of the AuthorizationServerContract update allowing to specify tokenEndpoint. */ + interface WithTokenEndpoint { + /** + * Specifies the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being + * referenced.. + * + * @param tokenEndpoint OAuth token endpoint. Contains absolute URI to entity being referenced. + * @return the next definition stage. + */ + Update withTokenEndpoint(String tokenEndpoint); + } + /** The stage of the AuthorizationServerContract update allowing to specify supportState. */ + interface WithSupportState { + /** + * Specifies the supportState property: If true, authorization server will include state parameter from the + * authorization request to its response. Client may use state parameter to raise protocol security.. + * + * @param supportState If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * @return the next definition stage. + */ + Update withSupportState(Boolean supportState); + } + /** The stage of the AuthorizationServerContract update allowing to specify defaultScope. */ + interface WithDefaultScope { + /** + * Specifies the defaultScope property: Access token scope that is going to be requested by default. Can be + * overridden at the API level. Should be provided in the form of a string containing space-delimited + * values.. + * + * @param defaultScope Access token scope that is going to be requested by default. Can be overridden at the + * API level. Should be provided in the form of a string containing space-delimited values. + * @return the next definition stage. + */ + Update withDefaultScope(String defaultScope); + } + /** The stage of the AuthorizationServerContract update allowing to specify bearerTokenSendingMethods. */ + interface WithBearerTokenSendingMethods { + /** + * Specifies the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed + * to the API. . + * + * @param bearerTokenSendingMethods Specifies the mechanism by which access token is passed to the API. + * @return the next definition stage. + */ + Update withBearerTokenSendingMethods(List bearerTokenSendingMethods); + } + /** The stage of the AuthorizationServerContract update allowing to specify resourceOwnerUsername. */ + interface WithResourceOwnerUsername { + /** + * Specifies the resourceOwnerUsername property: Can be optionally specified when resource owner password + * grant type is supported by this authorization server. Default resource owner username.. + * + * @param resourceOwnerUsername Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * @return the next definition stage. + */ + Update withResourceOwnerUsername(String resourceOwnerUsername); + } + /** The stage of the AuthorizationServerContract update allowing to specify resourceOwnerPassword. */ + interface WithResourceOwnerPassword { + /** + * Specifies the resourceOwnerPassword property: Can be optionally specified when resource owner password + * grant type is supported by this authorization server. Default resource owner password.. + * + * @param resourceOwnerPassword Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * @return the next definition stage. + */ + Update withResourceOwnerPassword(String resourceOwnerPassword); + } + /** The stage of the AuthorizationServerContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: User-friendly authorization server name.. + * + * @param displayName User-friendly authorization server name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the AuthorizationServerContract update allowing to specify clientRegistrationEndpoint. */ + interface WithClientRegistrationEndpoint { + /** + * Specifies the clientRegistrationEndpoint property: Optional reference to a page where client or app + * registration for this authorization server is performed. Contains absolute URL to entity being + * referenced.. + * + * @param clientRegistrationEndpoint Optional reference to a page where client or app registration for this + * authorization server is performed. Contains absolute URL to entity being referenced. + * @return the next definition stage. + */ + Update withClientRegistrationEndpoint(String clientRegistrationEndpoint); + } + /** The stage of the AuthorizationServerContract update allowing to specify authorizationEndpoint. */ + interface WithAuthorizationEndpoint { + /** + * Specifies the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2.. + * + * @param authorizationEndpoint OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * @return the next definition stage. + */ + Update withAuthorizationEndpoint(String authorizationEndpoint); + } + /** The stage of the AuthorizationServerContract update allowing to specify grantTypes. */ + interface WithGrantTypes { + /** + * Specifies the grantTypes property: Form of an authorization grant, which the client uses to request the + * access token.. + * + * @param grantTypes Form of an authorization grant, which the client uses to request the access token. + * @return the next definition stage. + */ + Update withGrantTypes(List grantTypes); + } + /** The stage of the AuthorizationServerContract update allowing to specify clientId. */ + interface WithClientId { + /** + * Specifies the clientId property: Client or app id registered with this authorization server.. + * + * @param clientId Client or app id registered with this authorization server. + * @return the next definition stage. + */ + Update withClientId(String clientId); + } + /** The stage of the AuthorizationServerContract update allowing to specify clientSecret. */ + interface WithClientSecret { + /** + * Specifies the clientSecret property: Client or app secret registered with this authorization server. This + * property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.. + * + * @param clientSecret Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * @return the next definition stage. + */ + Update withClientSecret(String clientSecret); + } + /** The stage of the AuthorizationServerContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AuthorizationServerContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AuthorizationServerContract refresh(Context context); + + /** + * Gets the client secret details of the authorization server. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + AuthorizationServerSecretsContract listSecrets(); + + /** + * Gets the client secret details of the authorization server. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + Response listSecretsWithResponse(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractBaseProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractBaseProperties.java new file mode 100644 index 0000000000000..f2c55af835fda --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractBaseProperties.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** External OAuth authorization server Update settings contract. */ +@Fluent +public class AuthorizationServerContractBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerContractBaseProperties.class); + + /* + * Description of the authorization server. Can contain HTML formatting + * tags. + */ + @JsonProperty(value = "description") + private String description; + + /* + * HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + */ + @JsonProperty(value = "authorizationMethods") + private List authorizationMethods; + + /* + * Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body + * is specified, client credentials and other parameters are passed within + * the request body in the application/x-www-form-urlencoded format. + */ + @JsonProperty(value = "clientAuthenticationMethod") + private List clientAuthenticationMethod; + + /* + * Additional parameters required by the token endpoint of this + * authorization server represented as an array of JSON objects with name + * and value string properties, i.e. {"name" : "name value", "value": "a + * value"}. + */ + @JsonProperty(value = "tokenBodyParameters") + private List tokenBodyParameters; + + /* + * OAuth token endpoint. Contains absolute URI to entity being referenced. + */ + @JsonProperty(value = "tokenEndpoint") + private String tokenEndpoint; + + /* + * If true, authorization server will include state parameter from the + * authorization request to its response. Client may use state parameter to + * raise protocol security. + */ + @JsonProperty(value = "supportState") + private Boolean supportState; + + /* + * Access token scope that is going to be requested by default. Can be + * overridden at the API level. Should be provided in the form of a string + * containing space-delimited values. + */ + @JsonProperty(value = "defaultScope") + private String defaultScope; + + /* + * Specifies the mechanism by which access token is passed to the API. + */ + @JsonProperty(value = "bearerTokenSendingMethods") + private List bearerTokenSendingMethods; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + */ + @JsonProperty(value = "resourceOwnerUsername") + private String resourceOwnerUsername; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + */ + @JsonProperty(value = "resourceOwnerPassword") + private String resourceOwnerPassword; + + /** + * Get the description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @param description the description value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @return the authorizationMethods value. + */ + public List authorizationMethods() { + return this.authorizationMethods; + } + + /** + * Set the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @param authorizationMethods the authorizationMethods value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withAuthorizationMethods( + List authorizationMethods) { + this.authorizationMethods = authorizationMethods; + return this; + } + + /** + * Get the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @return the clientAuthenticationMethod value. + */ + public List clientAuthenticationMethod() { + return this.clientAuthenticationMethod; + } + + /** + * Set the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @param clientAuthenticationMethod the clientAuthenticationMethod value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withClientAuthenticationMethod( + List clientAuthenticationMethod) { + this.clientAuthenticationMethod = clientAuthenticationMethod; + return this; + } + + /** + * Get the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @return the tokenBodyParameters value. + */ + public List tokenBodyParameters() { + return this.tokenBodyParameters; + } + + /** + * Set the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @param tokenBodyParameters the tokenBodyParameters value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withTokenBodyParameters( + List tokenBodyParameters) { + this.tokenBodyParameters = tokenBodyParameters; + return this; + } + + /** + * Get the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @return the supportState value. + */ + public Boolean supportState() { + return this.supportState; + } + + /** + * Set the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @param supportState the supportState value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withSupportState(Boolean supportState) { + this.supportState = supportState; + return this; + } + + /** + * Get the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @return the defaultScope value. + */ + public String defaultScope() { + return this.defaultScope; + } + + /** + * Set the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @param defaultScope the defaultScope value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withDefaultScope(String defaultScope) { + this.defaultScope = defaultScope; + return this; + } + + /** + * Get the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @return the bearerTokenSendingMethods value. + */ + public List bearerTokenSendingMethods() { + return this.bearerTokenSendingMethods; + } + + /** + * Set the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @param bearerTokenSendingMethods the bearerTokenSendingMethods value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + this.bearerTokenSendingMethods = bearerTokenSendingMethods; + return this; + } + + /** + * Get the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @return the resourceOwnerUsername value. + */ + public String resourceOwnerUsername() { + return this.resourceOwnerUsername; + } + + /** + * Set the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @param resourceOwnerUsername the resourceOwnerUsername value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withResourceOwnerUsername(String resourceOwnerUsername) { + this.resourceOwnerUsername = resourceOwnerUsername; + return this; + } + + /** + * Get the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @return the resourceOwnerPassword value. + */ + public String resourceOwnerPassword() { + return this.resourceOwnerPassword; + } + + /** + * Set the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @param resourceOwnerPassword the resourceOwnerPassword value to set. + * @return the AuthorizationServerContractBaseProperties object itself. + */ + public AuthorizationServerContractBaseProperties withResourceOwnerPassword(String resourceOwnerPassword) { + this.resourceOwnerPassword = resourceOwnerPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tokenBodyParameters() != null) { + tokenBodyParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractProperties.java new file mode 100644 index 0000000000000..bfe1ae3b6682c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerContractProperties.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.apimanagement.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; + +/** External OAuth authorization server settings Properties. */ +@Fluent +public final class AuthorizationServerContractProperties extends AuthorizationServerContractBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerContractProperties.class); + + /* + * User-friendly authorization server name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Optional reference to a page where client or app registration for this + * authorization server is performed. Contains absolute URL to entity being + * referenced. + */ + @JsonProperty(value = "clientRegistrationEndpoint", required = true) + private String clientRegistrationEndpoint; + + /* + * OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + */ + @JsonProperty(value = "authorizationEndpoint", required = true) + private String authorizationEndpoint; + + /* + * Form of an authorization grant, which the client uses to request the + * access token. + */ + @JsonProperty(value = "grantTypes", required = true) + private List grantTypes; + + /* + * Client or app id registered with this authorization server. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * Client or app secret registered with this authorization server. This + * property will not be filled on 'GET' operations! Use '/listSecrets' POST + * request to get the value. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Get the displayName property: User-friendly authorization server name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User-friendly authorization server name. + * + * @param displayName the displayName value to set. + * @return the AuthorizationServerContractProperties object itself. + */ + public AuthorizationServerContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @return the clientRegistrationEndpoint value. + */ + public String clientRegistrationEndpoint() { + return this.clientRegistrationEndpoint; + } + + /** + * Set the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @param clientRegistrationEndpoint the clientRegistrationEndpoint value to set. + * @return the AuthorizationServerContractProperties object itself. + */ + public AuthorizationServerContractProperties withClientRegistrationEndpoint(String clientRegistrationEndpoint) { + this.clientRegistrationEndpoint = clientRegistrationEndpoint; + return this; + } + + /** + * Get the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the AuthorizationServerContractProperties object itself. + */ + public AuthorizationServerContractProperties withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @return the grantTypes value. + */ + public List grantTypes() { + return this.grantTypes; + } + + /** + * Set the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @param grantTypes the grantTypes value to set. + * @return the AuthorizationServerContractProperties object itself. + */ + public AuthorizationServerContractProperties withGrantTypes(List grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + /** + * Get the clientId property: Client or app id registered with this authorization server. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client or app id registered with this authorization server. + * + * @param clientId the clientId value to set. + * @return the AuthorizationServerContractProperties object itself. + */ + public AuthorizationServerContractProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @param clientSecret the clientSecret value to set. + * @return the AuthorizationServerContractProperties object itself. + */ + public AuthorizationServerContractProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withAuthorizationMethods( + List authorizationMethods) { + super.withAuthorizationMethods(authorizationMethods); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withClientAuthenticationMethod( + List clientAuthenticationMethod) { + super.withClientAuthenticationMethod(clientAuthenticationMethod); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withTokenBodyParameters( + List tokenBodyParameters) { + super.withTokenBodyParameters(tokenBodyParameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withTokenEndpoint(String tokenEndpoint) { + super.withTokenEndpoint(tokenEndpoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withSupportState(Boolean supportState) { + super.withSupportState(supportState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withDefaultScope(String defaultScope) { + super.withDefaultScope(defaultScope); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + super.withBearerTokenSendingMethods(bearerTokenSendingMethods); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withResourceOwnerUsername(String resourceOwnerUsername) { + super.withResourceOwnerUsername(resourceOwnerUsername); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerContractProperties withResourceOwnerPassword(String resourceOwnerPassword) { + super.withResourceOwnerPassword(resourceOwnerPassword); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model AuthorizationServerContractProperties")); + } + if (clientRegistrationEndpoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientRegistrationEndpoint in model" + + " AuthorizationServerContractProperties")); + } + if (authorizationEndpoint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authorizationEndpoint in model" + + " AuthorizationServerContractProperties")); + } + if (grantTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property grantTypes in model AuthorizationServerContractProperties")); + } + if (clientId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientId in model AuthorizationServerContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerSecretsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerSecretsContract.java new file mode 100644 index 0000000000000..181d7a7937f86 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerSecretsContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner; + +/** An immutable client-side representation of AuthorizationServerSecretsContract. */ +public interface AuthorizationServerSecretsContract { + /** + * Gets the clientSecret property: oAuth Authorization Server Secrets. + * + * @return the clientSecret value. + */ + String clientSecret(); + + /** + * Gets the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @return the resourceOwnerUsername value. + */ + String resourceOwnerUsername(); + + /** + * Gets the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @return the resourceOwnerPassword value. + */ + String resourceOwnerPassword(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner + * object. + * + * @return the inner object. + */ + AuthorizationServerSecretsContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContract.java new file mode 100644 index 0000000000000..359cc6a3adcc6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContract.java @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** External OAuth authorization server settings. */ +@JsonFlatten +@Fluent +public class AuthorizationServerUpdateContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerUpdateContract.class); + + /* + * Description of the authorization server. Can contain HTML formatting + * tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + */ + @JsonProperty(value = "properties.authorizationMethods") + private List authorizationMethods; + + /* + * Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body + * is specified, client credentials and other parameters are passed within + * the request body in the application/x-www-form-urlencoded format. + */ + @JsonProperty(value = "properties.clientAuthenticationMethod") + private List clientAuthenticationMethod; + + /* + * Additional parameters required by the token endpoint of this + * authorization server represented as an array of JSON objects with name + * and value string properties, i.e. {"name" : "name value", "value": "a + * value"}. + */ + @JsonProperty(value = "properties.tokenBodyParameters") + private List tokenBodyParameters; + + /* + * OAuth token endpoint. Contains absolute URI to entity being referenced. + */ + @JsonProperty(value = "properties.tokenEndpoint") + private String tokenEndpoint; + + /* + * If true, authorization server will include state parameter from the + * authorization request to its response. Client may use state parameter to + * raise protocol security. + */ + @JsonProperty(value = "properties.supportState") + private Boolean supportState; + + /* + * Access token scope that is going to be requested by default. Can be + * overridden at the API level. Should be provided in the form of a string + * containing space-delimited values. + */ + @JsonProperty(value = "properties.defaultScope") + private String defaultScope; + + /* + * Specifies the mechanism by which access token is passed to the API. + */ + @JsonProperty(value = "properties.bearerTokenSendingMethods") + private List bearerTokenSendingMethods; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + */ + @JsonProperty(value = "properties.resourceOwnerUsername") + private String resourceOwnerUsername; + + /* + * Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + */ + @JsonProperty(value = "properties.resourceOwnerPassword") + private String resourceOwnerPassword; + + /* + * User-friendly authorization server name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Optional reference to a page where client or app registration for this + * authorization server is performed. Contains absolute URL to entity being + * referenced. + */ + @JsonProperty(value = "properties.clientRegistrationEndpoint") + private String clientRegistrationEndpoint; + + /* + * OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + */ + @JsonProperty(value = "properties.authorizationEndpoint") + private String authorizationEndpoint; + + /* + * Form of an authorization grant, which the client uses to request the + * access token. + */ + @JsonProperty(value = "properties.grantTypes") + private List grantTypes; + + /* + * Client or app id registered with this authorization server. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client or app secret registered with this authorization server. This + * property will not be filled on 'GET' operations! Use '/listSecrets' POST + * request to get the value. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the authorization server. Can contain HTML formatting tags. + * + * @param description the description value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @return the authorizationMethods value. + */ + public List authorizationMethods() { + return this.authorizationMethods; + } + + /** + * Set the authorizationMethods property: HTTP verbs supported by the authorization endpoint. GET must be always + * present. POST is optional. + * + * @param authorizationMethods the authorizationMethods value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withAuthorizationMethods(List authorizationMethods) { + this.authorizationMethods = authorizationMethods; + return this; + } + + /** + * Get the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @return the clientAuthenticationMethod value. + */ + public List clientAuthenticationMethod() { + return this.clientAuthenticationMethod; + } + + /** + * Set the clientAuthenticationMethod property: Method of authentication supported by the token endpoint of this + * authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other + * parameters are passed within the request body in the application/x-www-form-urlencoded format. + * + * @param clientAuthenticationMethod the clientAuthenticationMethod value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withClientAuthenticationMethod( + List clientAuthenticationMethod) { + this.clientAuthenticationMethod = clientAuthenticationMethod; + return this; + } + + /** + * Get the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @return the tokenBodyParameters value. + */ + public List tokenBodyParameters() { + return this.tokenBodyParameters; + } + + /** + * Set the tokenBodyParameters property: Additional parameters required by the token endpoint of this authorization + * server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name + * value", "value": "a value"}. + * + * @param tokenBodyParameters the tokenBodyParameters value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withTokenBodyParameters( + List tokenBodyParameters) { + this.tokenBodyParameters = tokenBodyParameters; + return this; + } + + /** + * Get the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: OAuth token endpoint. Contains absolute URI to entity being referenced. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @return the supportState value. + */ + public Boolean supportState() { + return this.supportState; + } + + /** + * Set the supportState property: If true, authorization server will include state parameter from the authorization + * request to its response. Client may use state parameter to raise protocol security. + * + * @param supportState the supportState value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withSupportState(Boolean supportState) { + this.supportState = supportState; + return this; + } + + /** + * Get the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @return the defaultScope value. + */ + public String defaultScope() { + return this.defaultScope; + } + + /** + * Set the defaultScope property: Access token scope that is going to be requested by default. Can be overridden at + * the API level. Should be provided in the form of a string containing space-delimited values. + * + * @param defaultScope the defaultScope value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withDefaultScope(String defaultScope) { + this.defaultScope = defaultScope; + return this; + } + + /** + * Get the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @return the bearerTokenSendingMethods value. + */ + public List bearerTokenSendingMethods() { + return this.bearerTokenSendingMethods; + } + + /** + * Set the bearerTokenSendingMethods property: Specifies the mechanism by which access token is passed to the API. + * + * @param bearerTokenSendingMethods the bearerTokenSendingMethods value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + this.bearerTokenSendingMethods = bearerTokenSendingMethods; + return this; + } + + /** + * Get the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @return the resourceOwnerUsername value. + */ + public String resourceOwnerUsername() { + return this.resourceOwnerUsername; + } + + /** + * Set the resourceOwnerUsername property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner username. + * + * @param resourceOwnerUsername the resourceOwnerUsername value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withResourceOwnerUsername(String resourceOwnerUsername) { + this.resourceOwnerUsername = resourceOwnerUsername; + return this; + } + + /** + * Get the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @return the resourceOwnerPassword value. + */ + public String resourceOwnerPassword() { + return this.resourceOwnerPassword; + } + + /** + * Set the resourceOwnerPassword property: Can be optionally specified when resource owner password grant type is + * supported by this authorization server. Default resource owner password. + * + * @param resourceOwnerPassword the resourceOwnerPassword value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withResourceOwnerPassword(String resourceOwnerPassword) { + this.resourceOwnerPassword = resourceOwnerPassword; + return this; + } + + /** + * Get the displayName property: User-friendly authorization server name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User-friendly authorization server name. + * + * @param displayName the displayName value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @return the clientRegistrationEndpoint value. + */ + public String clientRegistrationEndpoint() { + return this.clientRegistrationEndpoint; + } + + /** + * Set the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @param clientRegistrationEndpoint the clientRegistrationEndpoint value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withClientRegistrationEndpoint(String clientRegistrationEndpoint) { + this.clientRegistrationEndpoint = clientRegistrationEndpoint; + return this; + } + + /** + * Get the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @return the grantTypes value. + */ + public List grantTypes() { + return this.grantTypes; + } + + /** + * Set the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @param grantTypes the grantTypes value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withGrantTypes(List grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + /** + * Get the clientId property: Client or app id registered with this authorization server. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client or app id registered with this authorization server. + * + * @param clientId the clientId value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @param clientSecret the clientSecret value to set. + * @return the AuthorizationServerUpdateContract object itself. + */ + public AuthorizationServerUpdateContract withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tokenBodyParameters() != null) { + tokenBodyParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContractProperties.java new file mode 100644 index 0000000000000..72ccd06b410c4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServerUpdateContractProperties.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** External OAuth authorization server Update settings contract. */ +@Fluent +public final class AuthorizationServerUpdateContractProperties extends AuthorizationServerContractBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServerUpdateContractProperties.class); + + /* + * User-friendly authorization server name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Optional reference to a page where client or app registration for this + * authorization server is performed. Contains absolute URL to entity being + * referenced. + */ + @JsonProperty(value = "clientRegistrationEndpoint") + private String clientRegistrationEndpoint; + + /* + * OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + */ + @JsonProperty(value = "authorizationEndpoint") + private String authorizationEndpoint; + + /* + * Form of an authorization grant, which the client uses to request the + * access token. + */ + @JsonProperty(value = "grantTypes") + private List grantTypes; + + /* + * Client or app id registered with this authorization server. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Client or app secret registered with this authorization server. This + * property will not be filled on 'GET' operations! Use '/listSecrets' POST + * request to get the value. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Get the displayName property: User-friendly authorization server name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User-friendly authorization server name. + * + * @param displayName the displayName value to set. + * @return the AuthorizationServerUpdateContractProperties object itself. + */ + public AuthorizationServerUpdateContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @return the clientRegistrationEndpoint value. + */ + public String clientRegistrationEndpoint() { + return this.clientRegistrationEndpoint; + } + + /** + * Set the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for + * this authorization server is performed. Contains absolute URL to entity being referenced. + * + * @param clientRegistrationEndpoint the clientRegistrationEndpoint value to set. + * @return the AuthorizationServerUpdateContractProperties object itself. + */ + public AuthorizationServerUpdateContractProperties withClientRegistrationEndpoint( + String clientRegistrationEndpoint) { + this.clientRegistrationEndpoint = clientRegistrationEndpoint; + return this; + } + + /** + * Get the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: OAuth authorization endpoint. See + * http://tools.ietf.org/html/rfc6749#section-3.2. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the AuthorizationServerUpdateContractProperties object itself. + */ + public AuthorizationServerUpdateContractProperties withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @return the grantTypes value. + */ + public List grantTypes() { + return this.grantTypes; + } + + /** + * Set the grantTypes property: Form of an authorization grant, which the client uses to request the access token. + * + * @param grantTypes the grantTypes value to set. + * @return the AuthorizationServerUpdateContractProperties object itself. + */ + public AuthorizationServerUpdateContractProperties withGrantTypes(List grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + /** + * Get the clientId property: Client or app id registered with this authorization server. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client or app id registered with this authorization server. + * + * @param clientId the clientId value to set. + * @return the AuthorizationServerUpdateContractProperties object itself. + */ + public AuthorizationServerUpdateContractProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client or app secret registered with this authorization server. This property will + * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + * + * @param clientSecret the clientSecret value to set. + * @return the AuthorizationServerUpdateContractProperties object itself. + */ + public AuthorizationServerUpdateContractProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withAuthorizationMethods( + List authorizationMethods) { + super.withAuthorizationMethods(authorizationMethods); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withClientAuthenticationMethod( + List clientAuthenticationMethod) { + super.withClientAuthenticationMethod(clientAuthenticationMethod); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withTokenBodyParameters( + List tokenBodyParameters) { + super.withTokenBodyParameters(tokenBodyParameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withTokenEndpoint(String tokenEndpoint) { + super.withTokenEndpoint(tokenEndpoint); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withSupportState(Boolean supportState) { + super.withSupportState(supportState); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withDefaultScope(String defaultScope) { + super.withDefaultScope(defaultScope); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + super.withBearerTokenSendingMethods(bearerTokenSendingMethods); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withResourceOwnerUsername(String resourceOwnerUsername) { + super.withResourceOwnerUsername(resourceOwnerUsername); + return this; + } + + /** {@inheritDoc} */ + @Override + public AuthorizationServerUpdateContractProperties withResourceOwnerPassword(String resourceOwnerPassword) { + super.withResourceOwnerPassword(resourceOwnerPassword); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServers.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServers.java new file mode 100644 index 0000000000000..39776f440cdd8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServers.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 AuthorizationServers. */ +public interface AuthorizationServers { + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of authorization servers defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OAuth2 Authorization Servers list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String authsid); + + /** + * Gets the entity state (Etag) version of the authorizationServer specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the authorizationServer specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context); + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + AuthorizationServerContract get(String resourceGroupName, String serviceName, String authsid); + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context); + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String authsid, String ifMatch); + + /** + * Deletes specific authorization server instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String authsid, String ifMatch, Context context); + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + AuthorizationServerSecretsContract listSecrets(String resourceGroupName, String serviceName, String authsid); + + /** + * Gets the client secret details of the authorization server. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param authsid Identifier of the authorization server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the authorization server. + */ + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String authsid, Context context); + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + AuthorizationServerContract getById(String id); + + /** + * Gets the details of the authorization server specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the authorization server specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific authorization server instance. + * + * @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 specific authorization server instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new AuthorizationServerContract resource. + * + * @param name resource name. + * @return the first stage of the new AuthorizationServerContract definition. + */ + AuthorizationServerContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..6d3803038c048 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateHeaders.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.apimanagement.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 AuthorizationServersCreateOrUpdateHeaders model. */ +@Fluent +public final class AuthorizationServersCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServersCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the AuthorizationServersCreateOrUpdateHeaders object itself. + */ + public AuthorizationServersCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..6cec8c92631b1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class AuthorizationServersCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of AuthorizationServersCreateOrUpdateResponse. + * + * @param request the request which resulted in this AuthorizationServersCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AuthorizationServersCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AuthorizationServerContractInner value, + AuthorizationServersCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AuthorizationServerContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagHeaders.java new file mode 100644 index 0000000000000..9f8dbecd49d69 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagHeaders.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.apimanagement.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 AuthorizationServersGetEntityTagHeaders model. */ +@Fluent +public final class AuthorizationServersGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServersGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the AuthorizationServersGetEntityTagHeaders object itself. + */ + public AuthorizationServersGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagResponse.java new file mode 100644 index 0000000000000..325c6c9928698 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class AuthorizationServersGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of AuthorizationServersGetEntityTagResponse. + * + * @param request the request which resulted in this AuthorizationServersGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AuthorizationServersGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + AuthorizationServersGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetHeaders.java new file mode 100644 index 0000000000000..6ace5212bc44e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetHeaders.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.apimanagement.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 AuthorizationServersGetHeaders model. */ +@Fluent +public final class AuthorizationServersGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServersGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the AuthorizationServersGetHeaders object itself. + */ + public AuthorizationServersGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetResponse.java new file mode 100644 index 0000000000000..02c86b6218f91 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; + +/** Contains all response data for the get operation. */ +public final class AuthorizationServersGetResponse + extends ResponseBase { + /** + * Creates an instance of AuthorizationServersGetResponse. + * + * @param request the request which resulted in this AuthorizationServersGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AuthorizationServersGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AuthorizationServerContractInner value, + AuthorizationServersGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AuthorizationServerContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsHeaders.java new file mode 100644 index 0000000000000..30e9efea0d306 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsHeaders.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.apimanagement.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 AuthorizationServersListSecretsHeaders model. */ +@Fluent +public final class AuthorizationServersListSecretsHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServersListSecretsHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the AuthorizationServersListSecretsHeaders object itself. + */ + public AuthorizationServersListSecretsHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsResponse.java new file mode 100644 index 0000000000000..fa877e48f0edb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersListSecretsResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerSecretsContractInner; + +/** Contains all response data for the listSecrets operation. */ +public final class AuthorizationServersListSecretsResponse + extends ResponseBase { + /** + * Creates an instance of AuthorizationServersListSecretsResponse. + * + * @param request the request which resulted in this AuthorizationServersListSecretsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AuthorizationServersListSecretsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AuthorizationServerSecretsContractInner value, + AuthorizationServersListSecretsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AuthorizationServerSecretsContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateHeaders.java new file mode 100644 index 0000000000000..19075638e6059 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateHeaders.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.apimanagement.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 AuthorizationServersUpdateHeaders model. */ +@Fluent +public final class AuthorizationServersUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationServersUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the AuthorizationServersUpdateHeaders object itself. + */ + public AuthorizationServersUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateResponse.java new file mode 100644 index 0000000000000..7511fcd9f2e98 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/AuthorizationServersUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AuthorizationServerContractInner; + +/** Contains all response data for the update operation. */ +public final class AuthorizationServersUpdateResponse + extends ResponseBase { + /** + * Creates an instance of AuthorizationServersUpdateResponse. + * + * @param request the request which resulted in this AuthorizationServersUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AuthorizationServersUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AuthorizationServerContractInner value, + AuthorizationServersUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AuthorizationServerContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendAuthorizationHeaderCredentials.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendAuthorizationHeaderCredentials.java new file mode 100644 index 0000000000000..467c9b5077002 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendAuthorizationHeaderCredentials.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Authorization header information. */ +@Fluent +public final class BackendAuthorizationHeaderCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendAuthorizationHeaderCredentials.class); + + /* + * Authentication Scheme name. + */ + @JsonProperty(value = "scheme", required = true) + private String scheme; + + /* + * Authentication Parameter value. + */ + @JsonProperty(value = "parameter", required = true) + private String parameter; + + /** + * Get the scheme property: Authentication Scheme name. + * + * @return the scheme value. + */ + public String scheme() { + return this.scheme; + } + + /** + * Set the scheme property: Authentication Scheme name. + * + * @param scheme the scheme value to set. + * @return the BackendAuthorizationHeaderCredentials object itself. + */ + public BackendAuthorizationHeaderCredentials withScheme(String scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the parameter property: Authentication Parameter value. + * + * @return the parameter value. + */ + public String parameter() { + return this.parameter; + } + + /** + * Set the parameter property: Authentication Parameter value. + * + * @param parameter the parameter value to set. + * @return the BackendAuthorizationHeaderCredentials object itself. + */ + public BackendAuthorizationHeaderCredentials withParameter(String parameter) { + this.parameter = parameter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scheme() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property scheme in model BackendAuthorizationHeaderCredentials")); + } + if (parameter() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parameter in model BackendAuthorizationHeaderCredentials")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendBaseParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendBaseParameters.java new file mode 100644 index 0000000000000..4d1e4c6dc8547 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendBaseParameters.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 entity base Parameter set. */ +@Fluent +public class BackendBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendBaseParameters.class); + + /* + * Backend Title. + */ + @JsonProperty(value = "title") + private String title; + + /* + * Backend Description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Management Uri of the Resource in External System. This url can be the + * Arm Resource Id of Logic Apps, Function Apps or Api Apps. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * Backend Properties contract + */ + @JsonProperty(value = "properties") + private BackendProperties properties; + + /* + * Backend Credentials Contract Properties + */ + @JsonProperty(value = "credentials") + private BackendCredentialsContract credentials; + + /* + * Backend Proxy Contract Properties + */ + @JsonProperty(value = "proxy") + private BackendProxyContract proxy; + + /* + * Backend TLS Properties + */ + @JsonProperty(value = "tls") + private BackendTlsProperties tls; + + /** + * Get the title property: Backend Title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Backend Title. + * + * @param title the title value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Backend Description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Backend Description. + * + * @param description the description value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @param resourceId the resourceId value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the properties property: Backend Properties contract. + * + * @return the properties value. + */ + public BackendProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Backend Properties contract. + * + * @param properties the properties value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withProperties(BackendProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the credentials property: Backend Credentials Contract Properties. + * + * @return the credentials value. + */ + public BackendCredentialsContract credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Backend Credentials Contract Properties. + * + * @param credentials the credentials value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withCredentials(BackendCredentialsContract credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the proxy property: Backend Proxy Contract Properties. + * + * @return the proxy value. + */ + public BackendProxyContract proxy() { + return this.proxy; + } + + /** + * Set the proxy property: Backend Proxy Contract Properties. + * + * @param proxy the proxy value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withProxy(BackendProxyContract proxy) { + this.proxy = proxy; + return this; + } + + /** + * Get the tls property: Backend TLS Properties. + * + * @return the tls value. + */ + public BackendTlsProperties tls() { + return this.tls; + } + + /** + * Set the tls property: Backend TLS Properties. + * + * @param tls the tls value to set. + * @return the BackendBaseParameters object itself. + */ + public BackendBaseParameters withTls(BackendTlsProperties tls) { + this.tls = tls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + if (proxy() != null) { + proxy().validate(); + } + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCollection.java new file mode 100644 index 0000000000000..bd366d45daeaf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Backend list representation. */ +@Fluent +public final class BackendCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendCollection.class); + + /* + * Backend values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Backend values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Backend values. + * + * @param value the value value to set. + * @return the BackendCollection object itself. + */ + public BackendCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the BackendCollection object itself. + */ + public BackendCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the BackendCollection object itself. + */ + public BackendCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContract.java new file mode 100644 index 0000000000000..5f0b6545916ef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContract.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; + +/** An immutable client-side representation of BackendContract. */ +public interface BackendContract { + /** + * 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 title property: Backend Title. + * + * @return the title value. + */ + String title(); + + /** + * Gets the description property: Backend Description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the properties property: Backend Properties contract. + * + * @return the properties value. + */ + BackendProperties properties(); + + /** + * Gets the credentials property: Backend Credentials Contract Properties. + * + * @return the credentials value. + */ + BackendCredentialsContract credentials(); + + /** + * Gets the proxy property: Backend Proxy Contract Properties. + * + * @return the proxy value. + */ + BackendProxyContract proxy(); + + /** + * Gets the tls property: Backend TLS Properties. + * + * @return the tls value. + */ + BackendTlsProperties tls(); + + /** + * Gets the url property: Runtime Url of the Backend. + * + * @return the url value. + */ + String url(); + + /** + * Gets the protocol property: Backend communication protocol. + * + * @return the protocol value. + */ + BackendProtocol protocol(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner object. + * + * @return the inner object. + */ + BackendContractInner innerModel(); + + /** The entirety of the BackendContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BackendContract definition stages. */ + interface DefinitionStages { + /** The first stage of the BackendContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BackendContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the BackendContract 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.WithTitle, + DefinitionStages.WithDescription, + DefinitionStages.WithResourceId, + DefinitionStages.WithProperties, + DefinitionStages.WithCredentials, + DefinitionStages.WithProxy, + DefinitionStages.WithTls, + DefinitionStages.WithUrl, + DefinitionStages.WithProtocol, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + BackendContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BackendContract create(Context context); + } + /** The stage of the BackendContract definition allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: Backend Title.. + * + * @param title Backend Title. + * @return the next definition stage. + */ + WithCreate withTitle(String title); + } + /** The stage of the BackendContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Backend Description.. + * + * @param description Backend Description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the BackendContract definition allowing to specify resourceId. */ + interface WithResourceId { + /** + * Specifies the resourceId property: Management Uri of the Resource in External System. This url can be the + * Arm Resource Id of Logic Apps, Function Apps or Api Apps.. + * + * @param resourceId Management Uri of the Resource in External System. This url can be the Arm Resource Id + * of Logic Apps, Function Apps or Api Apps. + * @return the next definition stage. + */ + WithCreate withResourceId(String resourceId); + } + /** The stage of the BackendContract definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Backend Properties contract. + * + * @param properties Backend Properties contract. + * @return the next definition stage. + */ + WithCreate withProperties(BackendProperties properties); + } + /** The stage of the BackendContract definition allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: Backend Credentials Contract Properties. + * + * @param credentials Backend Credentials Contract Properties. + * @return the next definition stage. + */ + WithCreate withCredentials(BackendCredentialsContract credentials); + } + /** The stage of the BackendContract definition allowing to specify proxy. */ + interface WithProxy { + /** + * Specifies the proxy property: Backend Proxy Contract Properties. + * + * @param proxy Backend Proxy Contract Properties. + * @return the next definition stage. + */ + WithCreate withProxy(BackendProxyContract proxy); + } + /** The stage of the BackendContract definition allowing to specify tls. */ + interface WithTls { + /** + * Specifies the tls property: Backend TLS Properties. + * + * @param tls Backend TLS Properties. + * @return the next definition stage. + */ + WithCreate withTls(BackendTlsProperties tls); + } + /** The stage of the BackendContract definition allowing to specify url. */ + interface WithUrl { + /** + * Specifies the url property: Runtime Url of the Backend.. + * + * @param url Runtime Url of the Backend. + * @return the next definition stage. + */ + WithCreate withUrl(String url); + } + /** The stage of the BackendContract definition allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Backend communication protocol.. + * + * @param protocol Backend communication protocol. + * @return the next definition stage. + */ + WithCreate withProtocol(BackendProtocol protocol); + } + /** The stage of the BackendContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the BackendContract resource. + * + * @return the stage of resource update. + */ + BackendContract.Update update(); + + /** The template for BackendContract update. */ + interface Update + extends UpdateStages.WithTitle, + UpdateStages.WithDescription, + UpdateStages.WithResourceId, + UpdateStages.WithProperties, + UpdateStages.WithCredentials, + UpdateStages.WithProxy, + UpdateStages.WithTls, + UpdateStages.WithUrl, + UpdateStages.WithProtocol, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BackendContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BackendContract apply(Context context); + } + /** The BackendContract update stages. */ + interface UpdateStages { + /** The stage of the BackendContract update allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: Backend Title.. + * + * @param title Backend Title. + * @return the next definition stage. + */ + Update withTitle(String title); + } + /** The stage of the BackendContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Backend Description.. + * + * @param description Backend Description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the BackendContract update allowing to specify resourceId. */ + interface WithResourceId { + /** + * Specifies the resourceId property: Management Uri of the Resource in External System. This url can be the + * Arm Resource Id of Logic Apps, Function Apps or Api Apps.. + * + * @param resourceId Management Uri of the Resource in External System. This url can be the Arm Resource Id + * of Logic Apps, Function Apps or Api Apps. + * @return the next definition stage. + */ + Update withResourceId(String resourceId); + } + /** The stage of the BackendContract update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Backend Properties contract. + * + * @param properties Backend Properties contract. + * @return the next definition stage. + */ + Update withProperties(BackendProperties properties); + } + /** The stage of the BackendContract update allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: Backend Credentials Contract Properties. + * + * @param credentials Backend Credentials Contract Properties. + * @return the next definition stage. + */ + Update withCredentials(BackendCredentialsContract credentials); + } + /** The stage of the BackendContract update allowing to specify proxy. */ + interface WithProxy { + /** + * Specifies the proxy property: Backend Proxy Contract Properties. + * + * @param proxy Backend Proxy Contract Properties. + * @return the next definition stage. + */ + Update withProxy(BackendProxyContract proxy); + } + /** The stage of the BackendContract update allowing to specify tls. */ + interface WithTls { + /** + * Specifies the tls property: Backend TLS Properties. + * + * @param tls Backend TLS Properties. + * @return the next definition stage. + */ + Update withTls(BackendTlsProperties tls); + } + /** The stage of the BackendContract update allowing to specify url. */ + interface WithUrl { + /** + * Specifies the url property: Runtime Url of the Backend.. + * + * @param url Runtime Url of the Backend. + * @return the next definition stage. + */ + Update withUrl(String url); + } + /** The stage of the BackendContract update allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Backend communication protocol.. + * + * @param protocol Backend communication protocol. + * @return the next definition stage. + */ + Update withProtocol(BackendProtocol protocol); + } + /** The stage of the BackendContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BackendContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BackendContract refresh(Context context); + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @throws com.azure.core.management.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 reconnect(); + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param parameters Reconnect request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response reconnectWithResponse(BackendReconnectContract parameters, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContractProperties.java new file mode 100644 index 0000000000000..e801a578d6ec2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendContractProperties.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Create Backend operation. */ +@Fluent +public final class BackendContractProperties extends BackendBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendContractProperties.class); + + /* + * Runtime Url of the Backend. + */ + @JsonProperty(value = "url", required = true) + private String url; + + /* + * Backend communication protocol. + */ + @JsonProperty(value = "protocol", required = true) + private BackendProtocol protocol; + + /** + * Get the url property: Runtime Url of the Backend. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Runtime Url of the Backend. + * + * @param url the url value to set. + * @return the BackendContractProperties object itself. + */ + public BackendContractProperties withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the protocol property: Backend communication protocol. + * + * @return the protocol value. + */ + public BackendProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Backend communication protocol. + * + * @param protocol the protocol value to set. + * @return the BackendContractProperties object itself. + */ + public BackendContractProperties withProtocol(BackendProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withTitle(String title) { + super.withTitle(title); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withResourceId(String resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withProperties(BackendProperties properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withCredentials(BackendCredentialsContract credentials) { + super.withCredentials(credentials); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withProxy(BackendProxyContract proxy) { + super.withProxy(proxy); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendContractProperties withTls(BackendTlsProperties tls) { + super.withTls(tls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (url() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model BackendContractProperties")); + } + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocol in model BackendContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCredentialsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCredentialsContract.java new file mode 100644 index 0000000000000..8438eaf0a3138 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendCredentialsContract.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; +import java.util.Map; + +/** Details of the Credentials used to connect to Backend. */ +@Fluent +public final class BackendCredentialsContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendCredentialsContract.class); + + /* + * List of Client Certificate Ids. + */ + @JsonProperty(value = "certificateIds") + private List certificateIds; + + /* + * List of Client Certificate Thumbprints. Will be ignored if + * certificatesIds are provided. + */ + @JsonProperty(value = "certificate") + private List certificate; + + /* + * Query Parameter description. + */ + @JsonProperty(value = "query") + private Map> query; + + /* + * Header Parameter description. + */ + @JsonProperty(value = "header") + private Map> headerProperty; + + /* + * Authorization header authentication + */ + @JsonProperty(value = "authorization") + private BackendAuthorizationHeaderCredentials authorization; + + /** + * Get the certificateIds property: List of Client Certificate Ids. + * + * @return the certificateIds value. + */ + public List certificateIds() { + return this.certificateIds; + } + + /** + * Set the certificateIds property: List of Client Certificate Ids. + * + * @param certificateIds the certificateIds value to set. + * @return the BackendCredentialsContract object itself. + */ + public BackendCredentialsContract withCertificateIds(List certificateIds) { + this.certificateIds = certificateIds; + return this; + } + + /** + * Get the certificate property: List of Client Certificate Thumbprints. Will be ignored if certificatesIds are + * provided. + * + * @return the certificate value. + */ + public List certificate() { + return this.certificate; + } + + /** + * Set the certificate property: List of Client Certificate Thumbprints. Will be ignored if certificatesIds are + * provided. + * + * @param certificate the certificate value to set. + * @return the BackendCredentialsContract object itself. + */ + public BackendCredentialsContract withCertificate(List certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the query property: Query Parameter description. + * + * @return the query value. + */ + public Map> query() { + return this.query; + } + + /** + * Set the query property: Query Parameter description. + * + * @param query the query value to set. + * @return the BackendCredentialsContract object itself. + */ + public BackendCredentialsContract withQuery(Map> query) { + this.query = query; + return this; + } + + /** + * Get the headerProperty property: Header Parameter description. + * + * @return the headerProperty value. + */ + public Map> headerProperty() { + return this.headerProperty; + } + + /** + * Set the headerProperty property: Header Parameter description. + * + * @param headerProperty the headerProperty value to set. + * @return the BackendCredentialsContract object itself. + */ + public BackendCredentialsContract withHeaderProperty(Map> headerProperty) { + this.headerProperty = headerProperty; + return this; + } + + /** + * Get the authorization property: Authorization header authentication. + * + * @return the authorization value. + */ + public BackendAuthorizationHeaderCredentials authorization() { + return this.authorization; + } + + /** + * Set the authorization property: Authorization header authentication. + * + * @param authorization the authorization value to set. + * @return the BackendCredentialsContract object itself. + */ + public BackendCredentialsContract withAuthorization(BackendAuthorizationHeaderCredentials authorization) { + this.authorization = authorization; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorization() != null) { + authorization().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProperties.java new file mode 100644 index 0000000000000..a613b50496673 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Properties specific to the Backend Type. */ +@Fluent +public final class BackendProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendProperties.class); + + /* + * Backend Service Fabric Cluster Properties + */ + @JsonProperty(value = "serviceFabricCluster") + private BackendServiceFabricClusterProperties serviceFabricCluster; + + /** + * Get the serviceFabricCluster property: Backend Service Fabric Cluster Properties. + * + * @return the serviceFabricCluster value. + */ + public BackendServiceFabricClusterProperties serviceFabricCluster() { + return this.serviceFabricCluster; + } + + /** + * Set the serviceFabricCluster property: Backend Service Fabric Cluster Properties. + * + * @param serviceFabricCluster the serviceFabricCluster value to set. + * @return the BackendProperties object itself. + */ + public BackendProperties withServiceFabricCluster(BackendServiceFabricClusterProperties serviceFabricCluster) { + this.serviceFabricCluster = serviceFabricCluster; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceFabricCluster() != null) { + serviceFabricCluster().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProtocol.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProtocol.java new file mode 100644 index 0000000000000..116547e0be64e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProtocol.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackendProtocol. */ +public final class BackendProtocol extends ExpandableStringEnum { + /** Static value http for BackendProtocol. */ + public static final BackendProtocol HTTP = fromString("http"); + + /** Static value soap for BackendProtocol. */ + public static final BackendProtocol SOAP = fromString("soap"); + + /** + * Creates or finds a BackendProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackendProtocol. + */ + @JsonCreator + public static BackendProtocol fromString(String name) { + return fromString(name, BackendProtocol.class); + } + + /** @return known BackendProtocol values. */ + public static Collection values() { + return values(BackendProtocol.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProxyContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProxyContract.java new file mode 100644 index 0000000000000..8d0f2f7212052 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendProxyContract.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.apimanagement.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; + +/** Details of the Backend WebProxy Server to use in the Request to Backend. */ +@Fluent +public final class BackendProxyContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendProxyContract.class); + + /* + * WebProxy Server AbsoluteUri property which includes the entire URI + * stored in the Uri instance, including all fragments and query strings. + */ + @JsonProperty(value = "url", required = true) + private String url; + + /* + * Username to connect to the WebProxy server + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password to connect to the WebProxy Server + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the url property: WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri + * instance, including all fragments and query strings. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri + * instance, including all fragments and query strings. + * + * @param url the url value to set. + * @return the BackendProxyContract object itself. + */ + public BackendProxyContract withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the username property: Username to connect to the WebProxy server. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username to connect to the WebProxy server. + * + * @param username the username value to set. + * @return the BackendProxyContract object itself. + */ + public BackendProxyContract withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password to connect to the WebProxy Server. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password to connect to the WebProxy Server. + * + * @param password the password value to set. + * @return the BackendProxyContract object itself. + */ + public BackendProxyContract withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (url() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model BackendProxyContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendReconnectContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendReconnectContract.java new file mode 100644 index 0000000000000..0d89c2afb7313 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendReconnectContract.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Reconnect request parameters. */ +@JsonFlatten +@Fluent +public class BackendReconnectContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendReconnectContract.class); + + /* + * Duration in ISO8601 format after which reconnect will be initiated. + * Minimum duration of the Reconnect is PT2M. + */ + @JsonProperty(value = "properties.after") + private Duration after; + + /** + * Get the after property: Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of + * the Reconnect is PT2M. + * + * @return the after value. + */ + public Duration after() { + return this.after; + } + + /** + * Set the after property: Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of + * the Reconnect is PT2M. + * + * @param after the after value to set. + * @return the BackendReconnectContract object itself. + */ + public BackendReconnectContract withAfter(Duration after) { + this.after = after; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendServiceFabricClusterProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendServiceFabricClusterProperties.java new file mode 100644 index 0000000000000..e2b9750e82589 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendServiceFabricClusterProperties.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.apimanagement.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; + +/** Properties of the Service Fabric Type Backend. */ +@Fluent +public final class BackendServiceFabricClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendServiceFabricClusterProperties.class); + + /* + * The client certificate id for the management endpoint. + */ + @JsonProperty(value = "clientCertificateId") + private String clientCertificateId; + + /* + * The client certificate thumbprint for the management endpoint. Will be + * ignored if certificatesIds are provided + */ + @JsonProperty(value = "clientCertificatethumbprint") + private String clientCertificatethumbprint; + + /* + * Maximum number of retries while attempting resolve the partition. + */ + @JsonProperty(value = "maxPartitionResolutionRetries") + private Integer maxPartitionResolutionRetries; + + /* + * The cluster management endpoint. + */ + @JsonProperty(value = "managementEndpoints", required = true) + private List managementEndpoints; + + /* + * Thumbprints of certificates cluster management service uses for tls + * communication + */ + @JsonProperty(value = "serverCertificateThumbprints") + private List serverCertificateThumbprints; + + /* + * Server X509 Certificate Names Collection + */ + @JsonProperty(value = "serverX509Names") + private List serverX509Names; + + /** + * Get the clientCertificateId property: The client certificate id for the management endpoint. + * + * @return the clientCertificateId value. + */ + public String clientCertificateId() { + return this.clientCertificateId; + } + + /** + * Set the clientCertificateId property: The client certificate id for the management endpoint. + * + * @param clientCertificateId the clientCertificateId value to set. + * @return the BackendServiceFabricClusterProperties object itself. + */ + public BackendServiceFabricClusterProperties withClientCertificateId(String clientCertificateId) { + this.clientCertificateId = clientCertificateId; + return this; + } + + /** + * Get the clientCertificatethumbprint property: The client certificate thumbprint for the management endpoint. Will + * be ignored if certificatesIds are provided. + * + * @return the clientCertificatethumbprint value. + */ + public String clientCertificatethumbprint() { + return this.clientCertificatethumbprint; + } + + /** + * Set the clientCertificatethumbprint property: The client certificate thumbprint for the management endpoint. Will + * be ignored if certificatesIds are provided. + * + * @param clientCertificatethumbprint the clientCertificatethumbprint value to set. + * @return the BackendServiceFabricClusterProperties object itself. + */ + public BackendServiceFabricClusterProperties withClientCertificatethumbprint(String clientCertificatethumbprint) { + this.clientCertificatethumbprint = clientCertificatethumbprint; + return this; + } + + /** + * Get the maxPartitionResolutionRetries property: Maximum number of retries while attempting resolve the partition. + * + * @return the maxPartitionResolutionRetries value. + */ + public Integer maxPartitionResolutionRetries() { + return this.maxPartitionResolutionRetries; + } + + /** + * Set the maxPartitionResolutionRetries property: Maximum number of retries while attempting resolve the partition. + * + * @param maxPartitionResolutionRetries the maxPartitionResolutionRetries value to set. + * @return the BackendServiceFabricClusterProperties object itself. + */ + public BackendServiceFabricClusterProperties withMaxPartitionResolutionRetries( + Integer maxPartitionResolutionRetries) { + this.maxPartitionResolutionRetries = maxPartitionResolutionRetries; + return this; + } + + /** + * Get the managementEndpoints property: The cluster management endpoint. + * + * @return the managementEndpoints value. + */ + public List managementEndpoints() { + return this.managementEndpoints; + } + + /** + * Set the managementEndpoints property: The cluster management endpoint. + * + * @param managementEndpoints the managementEndpoints value to set. + * @return the BackendServiceFabricClusterProperties object itself. + */ + public BackendServiceFabricClusterProperties withManagementEndpoints(List managementEndpoints) { + this.managementEndpoints = managementEndpoints; + return this; + } + + /** + * Get the serverCertificateThumbprints property: Thumbprints of certificates cluster management service uses for + * tls communication. + * + * @return the serverCertificateThumbprints value. + */ + public List serverCertificateThumbprints() { + return this.serverCertificateThumbprints; + } + + /** + * Set the serverCertificateThumbprints property: Thumbprints of certificates cluster management service uses for + * tls communication. + * + * @param serverCertificateThumbprints the serverCertificateThumbprints value to set. + * @return the BackendServiceFabricClusterProperties object itself. + */ + public BackendServiceFabricClusterProperties withServerCertificateThumbprints( + List serverCertificateThumbprints) { + this.serverCertificateThumbprints = serverCertificateThumbprints; + return this; + } + + /** + * Get the serverX509Names property: Server X509 Certificate Names Collection. + * + * @return the serverX509Names value. + */ + public List serverX509Names() { + return this.serverX509Names; + } + + /** + * Set the serverX509Names property: Server X509 Certificate Names Collection. + * + * @param serverX509Names the serverX509Names value to set. + * @return the BackendServiceFabricClusterProperties object itself. + */ + public BackendServiceFabricClusterProperties withServerX509Names(List serverX509Names) { + this.serverX509Names = serverX509Names; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementEndpoints() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managementEndpoints in model" + + " BackendServiceFabricClusterProperties")); + } + if (serverX509Names() != null) { + serverX509Names().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendTlsProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendTlsProperties.java new file mode 100644 index 0000000000000..d144962f992ce --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendTlsProperties.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.apimanagement.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; + +/** Properties controlling TLS Certificate Validation. */ +@Fluent +public final class BackendTlsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendTlsProperties.class); + + /* + * Flag indicating whether SSL certificate chain validation should be done + * when using self-signed certificates for this backend host. + */ + @JsonProperty(value = "validateCertificateChain") + private Boolean validateCertificateChain; + + /* + * Flag indicating whether SSL certificate name validation should be done + * when using self-signed certificates for this backend host. + */ + @JsonProperty(value = "validateCertificateName") + private Boolean validateCertificateName; + + /** + * Get the validateCertificateChain property: Flag indicating whether SSL certificate chain validation should be + * done when using self-signed certificates for this backend host. + * + * @return the validateCertificateChain value. + */ + public Boolean validateCertificateChain() { + return this.validateCertificateChain; + } + + /** + * Set the validateCertificateChain property: Flag indicating whether SSL certificate chain validation should be + * done when using self-signed certificates for this backend host. + * + * @param validateCertificateChain the validateCertificateChain value to set. + * @return the BackendTlsProperties object itself. + */ + public BackendTlsProperties withValidateCertificateChain(Boolean validateCertificateChain) { + this.validateCertificateChain = validateCertificateChain; + return this; + } + + /** + * Get the validateCertificateName property: Flag indicating whether SSL certificate name validation should be done + * when using self-signed certificates for this backend host. + * + * @return the validateCertificateName value. + */ + public Boolean validateCertificateName() { + return this.validateCertificateName; + } + + /** + * Set the validateCertificateName property: Flag indicating whether SSL certificate name validation should be done + * when using self-signed certificates for this backend host. + * + * @param validateCertificateName the validateCertificateName value to set. + * @return the BackendTlsProperties object itself. + */ + public BackendTlsProperties withValidateCertificateName(Boolean validateCertificateName) { + this.validateCertificateName = validateCertificateName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameterProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameterProperties.java new file mode 100644 index 0000000000000..4c5853ac56329 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameterProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Update Backend operation. */ +@Fluent +public final class BackendUpdateParameterProperties extends BackendBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendUpdateParameterProperties.class); + + /* + * Runtime Url of the Backend. + */ + @JsonProperty(value = "url") + private String url; + + /* + * Backend communication protocol. + */ + @JsonProperty(value = "protocol") + private BackendProtocol protocol; + + /** + * Get the url property: Runtime Url of the Backend. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Runtime Url of the Backend. + * + * @param url the url value to set. + * @return the BackendUpdateParameterProperties object itself. + */ + public BackendUpdateParameterProperties withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the protocol property: Backend communication protocol. + * + * @return the protocol value. + */ + public BackendProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Backend communication protocol. + * + * @param protocol the protocol value to set. + * @return the BackendUpdateParameterProperties object itself. + */ + public BackendUpdateParameterProperties withProtocol(BackendProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withTitle(String title) { + super.withTitle(title); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withResourceId(String resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withProperties(BackendProperties properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withCredentials(BackendCredentialsContract credentials) { + super.withCredentials(credentials); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withProxy(BackendProxyContract proxy) { + super.withProxy(proxy); + return this; + } + + /** {@inheritDoc} */ + @Override + public BackendUpdateParameterProperties withTls(BackendTlsProperties tls) { + super.withTls(tls); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameters.java new file mode 100644 index 0000000000000..8e491d5b7a3f0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendUpdateParameters.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Backend update parameters. */ +@JsonFlatten +@Fluent +public class BackendUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendUpdateParameters.class); + + /* + * Backend Title. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Backend Description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Management Uri of the Resource in External System. This url can be the + * Arm Resource Id of Logic Apps, Function Apps or Api Apps. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /* + * Backend Properties contract + */ + @JsonProperty(value = "properties.properties") + private BackendProperties properties; + + /* + * Backend Credentials Contract Properties + */ + @JsonProperty(value = "properties.credentials") + private BackendCredentialsContract credentials; + + /* + * Backend Proxy Contract Properties + */ + @JsonProperty(value = "properties.proxy") + private BackendProxyContract proxy; + + /* + * Backend TLS Properties + */ + @JsonProperty(value = "properties.tls") + private BackendTlsProperties tls; + + /* + * Runtime Url of the Backend. + */ + @JsonProperty(value = "properties.url") + private String url; + + /* + * Backend communication protocol. + */ + @JsonProperty(value = "properties.protocol") + private BackendProtocol protocol; + + /** + * Get the title property: Backend Title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Backend Title. + * + * @param title the title value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Backend Description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Backend Description. + * + * @param description the description value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Management Uri of the Resource in External System. This url can be the Arm Resource + * Id of Logic Apps, Function Apps or Api Apps. + * + * @param resourceId the resourceId value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the properties property: Backend Properties contract. + * + * @return the properties value. + */ + public BackendProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Backend Properties contract. + * + * @param properties the properties value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withProperties(BackendProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the credentials property: Backend Credentials Contract Properties. + * + * @return the credentials value. + */ + public BackendCredentialsContract credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Backend Credentials Contract Properties. + * + * @param credentials the credentials value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withCredentials(BackendCredentialsContract credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the proxy property: Backend Proxy Contract Properties. + * + * @return the proxy value. + */ + public BackendProxyContract proxy() { + return this.proxy; + } + + /** + * Set the proxy property: Backend Proxy Contract Properties. + * + * @param proxy the proxy value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withProxy(BackendProxyContract proxy) { + this.proxy = proxy; + return this; + } + + /** + * Get the tls property: Backend TLS Properties. + * + * @return the tls value. + */ + public BackendTlsProperties tls() { + return this.tls; + } + + /** + * Set the tls property: Backend TLS Properties. + * + * @param tls the tls value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withTls(BackendTlsProperties tls) { + this.tls = tls; + return this; + } + + /** + * Get the url property: Runtime Url of the Backend. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Runtime Url of the Backend. + * + * @param url the url value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the protocol property: Backend communication protocol. + * + * @return the protocol value. + */ + public BackendProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Backend communication protocol. + * + * @param protocol the protocol value to set. + * @return the BackendUpdateParameters object itself. + */ + public BackendUpdateParameters withProtocol(BackendProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (credentials() != null) { + credentials().validate(); + } + if (proxy() != null) { + proxy().validate(); + } + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Backends.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Backends.java new file mode 100644 index 0000000000000..aaa68ee6ca6d3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Backends.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.apimanagement.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 Backends. */ +public interface Backends { + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of backends in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| url | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Backend list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String backendId); + + /** + * Gets the entity state (Etag) version of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the backend specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context); + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + BackendContract get(String resourceGroupName, String serviceName, String backendId); + + /** + * Gets the details of the backend specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String backendId, Context context); + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String backendId, String ifMatch); + + /** + * Deletes the specified backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String backendId, String ifMatch, Context context); + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reconnect(String resourceGroupName, String serviceName, String backendId); + + /** + * Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout was + * specified, timeout of 2 minutes is used. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param backendId Identifier of the Backend entity. Must be unique in the current API Management service instance. + * @param parameters Reconnect request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response reconnectWithResponse( + String resourceGroupName, + String serviceName, + String backendId, + BackendReconnectContract parameters, + Context context); + + /** + * Gets the details of the backend specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + BackendContract getById(String id); + + /** + * Gets the details of the backend specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the backend specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified backend. + * + * @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 the specified backend. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new BackendContract resource. + * + * @param name resource name. + * @return the first stage of the new BackendContract definition. + */ + BackendContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..95937b3dc3afc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateHeaders.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.apimanagement.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 BackendsCreateOrUpdateHeaders model. */ +@Fluent +public final class BackendsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BackendsCreateOrUpdateHeaders object itself. + */ + public BackendsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..764438f8c7696 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class BackendsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of BackendsCreateOrUpdateResponse. + * + * @param request the request which resulted in this BackendsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BackendsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + BackendContractInner value, + BackendsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public BackendContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..24f1a6e6d3b9f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagHeaders.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.apimanagement.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 BackendsGetEntityTagHeaders model. */ +@Fluent +public final class BackendsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BackendsGetEntityTagHeaders object itself. + */ + public BackendsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagResponse.java new file mode 100644 index 0000000000000..0aba13f5ea627 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class BackendsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of BackendsGetEntityTagResponse. + * + * @param request the request which resulted in this BackendsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BackendsGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, BackendsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetHeaders.java new file mode 100644 index 0000000000000..9d3fbf08a10a1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetHeaders.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.apimanagement.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 BackendsGetHeaders model. */ +@Fluent +public final class BackendsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BackendsGetHeaders object itself. + */ + public BackendsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetResponse.java new file mode 100644 index 0000000000000..e80b5f23503d9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; + +/** Contains all response data for the get operation. */ +public final class BackendsGetResponse extends ResponseBase { + /** + * Creates an instance of BackendsGetResponse. + * + * @param request the request which resulted in this BackendsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BackendsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + BackendContractInner value, + BackendsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public BackendContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateHeaders.java new file mode 100644 index 0000000000000..8ea89d5be39ba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateHeaders.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.apimanagement.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 BackendsUpdateHeaders model. */ +@Fluent +public final class BackendsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackendsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BackendsUpdateHeaders object itself. + */ + public BackendsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateResponse.java new file mode 100644 index 0000000000000..25a7b5abea79d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BackendsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.BackendContractInner; + +/** Contains all response data for the update operation. */ +public final class BackendsUpdateResponse extends ResponseBase { + /** + * Creates an instance of BackendsUpdateResponse. + * + * @param request the request which resulted in this BackendsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BackendsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + BackendContractInner value, + BackendsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public BackendContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethod.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethod.java new file mode 100644 index 0000000000000..00e9161f80fae --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethod.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BearerTokenSendingMethod. */ +public final class BearerTokenSendingMethod extends ExpandableStringEnum { + /** Static value authorizationHeader for BearerTokenSendingMethod. */ + public static final BearerTokenSendingMethod AUTHORIZATION_HEADER = fromString("authorizationHeader"); + + /** Static value query for BearerTokenSendingMethod. */ + public static final BearerTokenSendingMethod QUERY = fromString("query"); + + /** + * Creates or finds a BearerTokenSendingMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding BearerTokenSendingMethod. + */ + @JsonCreator + public static BearerTokenSendingMethod fromString(String name) { + return fromString(name, BearerTokenSendingMethod.class); + } + + /** @return known BearerTokenSendingMethod values. */ + public static Collection values() { + return values(BearerTokenSendingMethod.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethods.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethods.java new file mode 100644 index 0000000000000..be54ba2941b1c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BearerTokenSendingMethods.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BearerTokenSendingMethods. */ +public final class BearerTokenSendingMethods extends ExpandableStringEnum { + /** Static value authorizationHeader for BearerTokenSendingMethods. */ + public static final BearerTokenSendingMethods AUTHORIZATION_HEADER = fromString("authorizationHeader"); + + /** Static value query for BearerTokenSendingMethods. */ + public static final BearerTokenSendingMethods QUERY = fromString("query"); + + /** + * Creates or finds a BearerTokenSendingMethods from its string representation. + * + * @param name a name to look for. + * @return the corresponding BearerTokenSendingMethods. + */ + @JsonCreator + public static BearerTokenSendingMethods fromString(String name) { + return fromString(name, BearerTokenSendingMethods.class); + } + + /** @return known BearerTokenSendingMethods values. */ + public static Collection values() { + return values(BearerTokenSendingMethods.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BodyDiagnosticSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BodyDiagnosticSettings.java new file mode 100644 index 0000000000000..1d63514a19bdc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/BodyDiagnosticSettings.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.apimanagement.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; + +/** Body logging settings. */ +@Fluent +public final class BodyDiagnosticSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BodyDiagnosticSettings.class); + + /* + * Number of request body bytes to log. + */ + @JsonProperty(value = "bytes") + private Integer bytes; + + /** + * Get the bytes property: Number of request body bytes to log. + * + * @return the bytes value. + */ + public Integer bytes() { + return this.bytes; + } + + /** + * Set the bytes property: Number of request body bytes to log. + * + * @param bytes the bytes value to set. + * @return the BodyDiagnosticSettings object itself. + */ + public BodyDiagnosticSettings withBytes(Integer bytes) { + this.bytes = bytes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheCollection.java new file mode 100644 index 0000000000000..d62539c8bcd00 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Caches list representation. */ +@Fluent +public final class CacheCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the CacheCollection object itself. + */ + public CacheCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the CacheCollection object itself. + */ + public CacheCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the CacheCollection object itself. + */ + public CacheCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheContract.java new file mode 100644 index 0000000000000..240135f31a734 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheContract.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; + +/** An immutable client-side representation of CacheContract. */ +public interface CacheContract { + /** + * 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 description property: Cache description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the connectionString property: Runtime connection string to cache. + * + * @return the connectionString value. + */ + String connectionString(); + + /** + * Gets the useFromLocation property: Location identifier to use cache from (should be either 'default' or valid + * Azure region identifier). + * + * @return the useFromLocation value. + */ + String useFromLocation(); + + /** + * Gets the resourceId property: Original uri of entity in external system cache points to. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner object. + * + * @return the inner object. + */ + CacheContractInner innerModel(); + + /** The entirety of the CacheContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CacheContract definition stages. */ + interface DefinitionStages { + /** The first stage of the CacheContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CacheContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the CacheContract 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.WithDescription, + DefinitionStages.WithConnectionString, + DefinitionStages.WithUseFromLocation, + DefinitionStages.WithResourceId, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + CacheContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CacheContract create(Context context); + } + /** The stage of the CacheContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Cache description. + * + * @param description Cache description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the CacheContract definition allowing to specify connectionString. */ + interface WithConnectionString { + /** + * Specifies the connectionString property: Runtime connection string to cache. + * + * @param connectionString Runtime connection string to cache. + * @return the next definition stage. + */ + WithCreate withConnectionString(String connectionString); + } + /** The stage of the CacheContract definition allowing to specify useFromLocation. */ + interface WithUseFromLocation { + /** + * Specifies the useFromLocation property: Location identifier to use cache from (should be either 'default' + * or valid Azure region identifier). + * + * @param useFromLocation Location identifier to use cache from (should be either 'default' or valid Azure + * region identifier). + * @return the next definition stage. + */ + WithCreate withUseFromLocation(String useFromLocation); + } + /** The stage of the CacheContract definition allowing to specify resourceId. */ + interface WithResourceId { + /** + * Specifies the resourceId property: Original uri of entity in external system cache points to. + * + * @param resourceId Original uri of entity in external system cache points to. + * @return the next definition stage. + */ + WithCreate withResourceId(String resourceId); + } + /** The stage of the CacheContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the CacheContract resource. + * + * @return the stage of resource update. + */ + CacheContract.Update update(); + + /** The template for CacheContract update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithConnectionString, + UpdateStages.WithUseFromLocation, + UpdateStages.WithResourceId, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CacheContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CacheContract apply(Context context); + } + /** The CacheContract update stages. */ + interface UpdateStages { + /** The stage of the CacheContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Cache description. + * + * @param description Cache description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the CacheContract update allowing to specify connectionString. */ + interface WithConnectionString { + /** + * Specifies the connectionString property: Runtime connection string to cache. + * + * @param connectionString Runtime connection string to cache. + * @return the next definition stage. + */ + Update withConnectionString(String connectionString); + } + /** The stage of the CacheContract update allowing to specify useFromLocation. */ + interface WithUseFromLocation { + /** + * Specifies the useFromLocation property: Location identifier to use cache from (should be either 'default' + * or valid Azure region identifier). + * + * @param useFromLocation Location identifier to use cache from (should be either 'default' or valid Azure + * region identifier). + * @return the next definition stage. + */ + Update withUseFromLocation(String useFromLocation); + } + /** The stage of the CacheContract update allowing to specify resourceId. */ + interface WithResourceId { + /** + * Specifies the resourceId property: Original uri of entity in external system cache points to. + * + * @param resourceId Original uri of entity in external system cache points to. + * @return the next definition stage. + */ + Update withResourceId(String resourceId); + } + /** The stage of the CacheContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CacheContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CacheContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheUpdateParameters.java new file mode 100644 index 0000000000000..6077285bf3bfc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CacheUpdateParameters.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.apimanagement.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; + +/** Cache update details. */ +@JsonFlatten +@Fluent +public class CacheUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CacheUpdateParameters.class); + + /* + * Cache description + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Runtime connection string to cache + */ + @JsonProperty(value = "properties.connectionString") + private String connectionString; + + /* + * Location identifier to use cache from (should be either 'default' or + * valid Azure region identifier) + */ + @JsonProperty(value = "properties.useFromLocation") + private String useFromLocation; + + /* + * Original uri of entity in external system cache points to + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * Get the description property: Cache description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Cache description. + * + * @param description the description value to set. + * @return the CacheUpdateParameters object itself. + */ + public CacheUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the connectionString property: Runtime connection string to cache. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: Runtime connection string to cache. + * + * @param connectionString the connectionString value to set. + * @return the CacheUpdateParameters object itself. + */ + public CacheUpdateParameters withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the useFromLocation property: Location identifier to use cache from (should be either 'default' or valid + * Azure region identifier). + * + * @return the useFromLocation value. + */ + public String useFromLocation() { + return this.useFromLocation; + } + + /** + * Set the useFromLocation property: Location identifier to use cache from (should be either 'default' or valid + * Azure region identifier). + * + * @param useFromLocation the useFromLocation value to set. + * @return the CacheUpdateParameters object itself. + */ + public CacheUpdateParameters withUseFromLocation(String useFromLocation) { + this.useFromLocation = useFromLocation; + return this; + } + + /** + * Get the resourceId property: Original uri of entity in external system cache points to. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Original uri of entity in external system cache points to. + * + * @param resourceId the resourceId value to set. + * @return the CacheUpdateParameters object itself. + */ + public CacheUpdateParameters withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Caches.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Caches.java new file mode 100644 index 0000000000000..f4da69f027b4e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Caches.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.apimanagement.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 Caches. */ +public interface Caches { + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of all external Caches in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Caches list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String cacheId); + + /** + * Gets the entity state (Etag) version of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Cache specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context); + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + CacheContract get(String resourceGroupName, String serviceName, String cacheId); + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String cacheId, Context context); + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String cacheId, String ifMatch); + + /** + * Deletes specific Cache. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param cacheId Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region + * identifier). + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String cacheId, String ifMatch, Context context); + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + CacheContract getById(String id); + + /** + * Gets the details of the Cache specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Cache specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific Cache. + * + * @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 specific Cache. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new CacheContract resource. + * + * @param name resource name. + * @return the first stage of the new CacheContract definition. + */ + CacheContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..95afcff87035d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateHeaders.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.apimanagement.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 CachesCreateOrUpdateHeaders model. */ +@Fluent +public final class CachesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CachesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CachesCreateOrUpdateHeaders object itself. + */ + public CachesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..5e4bc64b631f2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class CachesCreateOrUpdateResponse extends ResponseBase { + /** + * Creates an instance of CachesCreateOrUpdateResponse. + * + * @param request the request which resulted in this CachesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CachesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CacheContractInner value, + CachesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CacheContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..eddb62040b250 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagHeaders.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.apimanagement.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 CachesGetEntityTagHeaders model. */ +@Fluent +public final class CachesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CachesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CachesGetEntityTagHeaders object itself. + */ + public CachesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagResponse.java new file mode 100644 index 0000000000000..c3cf9b0696361 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class CachesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of CachesGetEntityTagResponse. + * + * @param request the request which resulted in this CachesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CachesGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, CachesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetHeaders.java new file mode 100644 index 0000000000000..785250135fc12 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetHeaders.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.apimanagement.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 CachesGetHeaders model. */ +@Fluent +public final class CachesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CachesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CachesGetHeaders object itself. + */ + public CachesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetResponse.java new file mode 100644 index 0000000000000..5b3afd413cf7b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; + +/** Contains all response data for the get operation. */ +public final class CachesGetResponse extends ResponseBase { + /** + * Creates an instance of CachesGetResponse. + * + * @param request the request which resulted in this CachesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CachesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CacheContractInner value, + CachesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CacheContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateHeaders.java new file mode 100644 index 0000000000000..c25d901070989 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateHeaders.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.apimanagement.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 CachesUpdateHeaders model. */ +@Fluent +public final class CachesUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CachesUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CachesUpdateHeaders object itself. + */ + public CachesUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateResponse.java new file mode 100644 index 0000000000000..f0ad657fbb702 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CachesUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.CacheContractInner; + +/** Contains all response data for the update operation. */ +public final class CachesUpdateResponse extends ResponseBase { + /** + * Creates an instance of CachesUpdateResponse. + * + * @param request the request which resulted in this CachesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CachesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CacheContractInner value, + CachesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CacheContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCollection.java new file mode 100644 index 0000000000000..52b974ab54f38 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Certificates list representation. */ +@Fluent +public final class CertificateCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the CertificateCollection object itself. + */ + public CertificateCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the CertificateCollection object itself. + */ + public CertificateCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the CertificateCollection object itself. + */ + public CertificateCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfiguration.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfiguration.java new file mode 100644 index 0000000000000..21c513b8015ca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfiguration.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate configuration which consist of non-trusted intermediates and root certificates. */ +@Fluent +public final class CertificateConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateConfiguration.class); + + /* + * Base64 Encoded certificate. + */ + @JsonProperty(value = "encodedCertificate") + private String encodedCertificate; + + /* + * Certificate Password. + */ + @JsonProperty(value = "certificatePassword") + private String certificatePassword; + + /* + * The System.Security.Cryptography.x509certificates.StoreName certificate + * store location. Only Root and CertificateAuthority are valid locations. + */ + @JsonProperty(value = "storeName", required = true) + private CertificateConfigurationStoreName storeName; + + /* + * Certificate information. + */ + @JsonProperty(value = "certificate") + private CertificateInformation certificate; + + /** + * Get the encodedCertificate property: Base64 Encoded certificate. + * + * @return the encodedCertificate value. + */ + public String encodedCertificate() { + return this.encodedCertificate; + } + + /** + * Set the encodedCertificate property: Base64 Encoded certificate. + * + * @param encodedCertificate the encodedCertificate value to set. + * @return the CertificateConfiguration object itself. + */ + public CertificateConfiguration withEncodedCertificate(String encodedCertificate) { + this.encodedCertificate = encodedCertificate; + return this; + } + + /** + * Get the certificatePassword property: Certificate Password. + * + * @return the certificatePassword value. + */ + public String certificatePassword() { + return this.certificatePassword; + } + + /** + * Set the certificatePassword property: Certificate Password. + * + * @param certificatePassword the certificatePassword value to set. + * @return the CertificateConfiguration object itself. + */ + public CertificateConfiguration withCertificatePassword(String certificatePassword) { + this.certificatePassword = certificatePassword; + return this; + } + + /** + * Get the storeName property: The System.Security.Cryptography.x509certificates.StoreName certificate store + * location. Only Root and CertificateAuthority are valid locations. + * + * @return the storeName value. + */ + public CertificateConfigurationStoreName storeName() { + return this.storeName; + } + + /** + * Set the storeName property: The System.Security.Cryptography.x509certificates.StoreName certificate store + * location. Only Root and CertificateAuthority are valid locations. + * + * @param storeName the storeName value to set. + * @return the CertificateConfiguration object itself. + */ + public CertificateConfiguration withStoreName(CertificateConfigurationStoreName storeName) { + this.storeName = storeName; + return this; + } + + /** + * Get the certificate property: Certificate information. + * + * @return the certificate value. + */ + public CertificateInformation certificate() { + return this.certificate; + } + + /** + * Set the certificate property: Certificate information. + * + * @param certificate the certificate value to set. + * @return the CertificateConfiguration object itself. + */ + public CertificateConfiguration withCertificate(CertificateInformation certificate) { + this.certificate = certificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storeName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storeName in model CertificateConfiguration")); + } + if (certificate() != null) { + certificate().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfigurationStoreName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfigurationStoreName.java new file mode 100644 index 0000000000000..a8d2e6ca218a1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateConfigurationStoreName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CertificateConfigurationStoreName. */ +public final class CertificateConfigurationStoreName extends ExpandableStringEnum { + /** Static value CertificateAuthority for CertificateConfigurationStoreName. */ + public static final CertificateConfigurationStoreName CERTIFICATE_AUTHORITY = fromString("CertificateAuthority"); + + /** Static value Root for CertificateConfigurationStoreName. */ + public static final CertificateConfigurationStoreName ROOT = fromString("Root"); + + /** + * Creates or finds a CertificateConfigurationStoreName from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateConfigurationStoreName. + */ + @JsonCreator + public static CertificateConfigurationStoreName fromString(String name) { + return fromString(name, CertificateConfigurationStoreName.class); + } + + /** @return known CertificateConfigurationStoreName values. */ + public static Collection values() { + return values(CertificateConfigurationStoreName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateContract.java new file mode 100644 index 0000000000000..227e926a48768 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateContract.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of CertificateContract. */ +public interface CertificateContract { + /** + * 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 subject property: Subject attribute of the certificate. + * + * @return the subject value. + */ + String subject(); + + /** + * Gets the thumbprint property: Thumbprint of the certificate. + * + * @return the thumbprint value. + */ + String thumbprint(); + + /** + * Gets the expirationDate property: Expiration date of the certificate. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the keyVault property: KeyVault location details of the certificate. + * + * @return the keyVault value. + */ + KeyVaultContractProperties keyVault(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner object. + * + * @return the inner object. + */ + CertificateContractInner innerModel(); + + /** The entirety of the CertificateContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CertificateContract definition stages. */ + interface DefinitionStages { + /** The first stage of the CertificateContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CertificateContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the CertificateContract 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.WithData, + DefinitionStages.WithPassword, + DefinitionStages.WithKeyVault, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + CertificateContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CertificateContract create(Context context); + } + /** The stage of the CertificateContract definition allowing to specify data. */ + interface WithData { + /** + * Specifies the data property: Base 64 encoded certificate using the application/x-pkcs12 representation.. + * + * @param data Base 64 encoded certificate using the application/x-pkcs12 representation. + * @return the next definition stage. + */ + WithCreate withData(String data); + } + /** The stage of the CertificateContract definition allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: Password for the Certificate. + * + * @param password Password for the Certificate. + * @return the next definition stage. + */ + WithCreate withPassword(String password); + } + /** The stage of the CertificateContract definition allowing to specify keyVault. */ + interface WithKeyVault { + /** + * Specifies the keyVault property: KeyVault location details of the certificate.. + * + * @param keyVault KeyVault location details of the certificate. + * @return the next definition stage. + */ + WithCreate withKeyVault(KeyVaultContractCreateProperties keyVault); + } + /** The stage of the CertificateContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the CertificateContract resource. + * + * @return the stage of resource update. + */ + CertificateContract.Update update(); + + /** The template for CertificateContract update. */ + interface Update + extends UpdateStages.WithData, UpdateStages.WithPassword, UpdateStages.WithKeyVault, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CertificateContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CertificateContract apply(Context context); + } + /** The CertificateContract update stages. */ + interface UpdateStages { + /** The stage of the CertificateContract update allowing to specify data. */ + interface WithData { + /** + * Specifies the data property: Base 64 encoded certificate using the application/x-pkcs12 representation.. + * + * @param data Base 64 encoded certificate using the application/x-pkcs12 representation. + * @return the next definition stage. + */ + Update withData(String data); + } + /** The stage of the CertificateContract update allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: Password for the Certificate. + * + * @param password Password for the Certificate. + * @return the next definition stage. + */ + Update withPassword(String password); + } + /** The stage of the CertificateContract update allowing to specify keyVault. */ + interface WithKeyVault { + /** + * Specifies the keyVault property: KeyVault location details of the certificate.. + * + * @param keyVault KeyVault location details of the certificate. + * @return the next definition stage. + */ + Update withKeyVault(KeyVaultContractCreateProperties keyVault); + } + /** The stage of the CertificateContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CertificateContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CertificateContract refresh(Context context); + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + CertificateContract refreshSecret(); + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + Response refreshSecretWithResponse(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCreateOrUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..b26c5bd91b71d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateCreateOrUpdateParameters.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Certificate create or update details. */ +@JsonFlatten +@Fluent +public class CertificateCreateOrUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateCreateOrUpdateParameters.class); + + /* + * Base 64 encoded certificate using the application/x-pkcs12 + * representation. + */ + @JsonProperty(value = "properties.data") + private String data; + + /* + * Password for the Certificate + */ + @JsonProperty(value = "properties.password") + private String password; + + /* + * KeyVault location details of the certificate. + */ + @JsonProperty(value = "properties.keyVault") + private KeyVaultContractCreateProperties keyVault; + + /** + * Get the data property: Base 64 encoded certificate using the application/x-pkcs12 representation. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: Base 64 encoded certificate using the application/x-pkcs12 representation. + * + * @param data the data value to set. + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withData(String data) { + this.data = data; + return this; + } + + /** + * Get the password property: Password for the Certificate. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password for the Certificate. + * + * @param password the password value to set. + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the certificate. + * + * @return the keyVault value. + */ + public KeyVaultContractCreateProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the certificate. + * + * @param keyVault the keyVault value to set. + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withKeyVault(KeyVaultContractCreateProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateInformation.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateInformation.java new file mode 100644 index 0000000000000..b77fecbff1435 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificateInformation.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** SSL certificate information. */ +@Fluent +public final class CertificateInformation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateInformation.class); + + /* + * Expiration date of the certificate. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + */ + @JsonProperty(value = "expiry", required = true) + private OffsetDateTime expiry; + + /* + * Thumbprint of the certificate. + */ + @JsonProperty(value = "thumbprint", required = true) + private String thumbprint; + + /* + * Subject of the certificate. + */ + @JsonProperty(value = "subject", required = true) + private String subject; + + /** + * Get the expiry property: Expiration date of the certificate. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: Expiration date of the certificate. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param expiry the expiry value to set. + * @return the CertificateInformation object itself. + */ + public CertificateInformation withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the thumbprint property: Thumbprint of the certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Thumbprint of the certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the CertificateInformation object itself. + */ + public CertificateInformation withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the subject property: Subject of the certificate. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject of the certificate. + * + * @param subject the subject value to set. + * @return the CertificateInformation object itself. + */ + public CertificateInformation withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expiry() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property expiry in model CertificateInformation")); + } + if (thumbprint() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property thumbprint in model CertificateInformation")); + } + if (subject() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property subject in model CertificateInformation")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Certificates.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Certificates.java new file mode 100644 index 0000000000000..32e9be88a7dfc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Certificates.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Certificates. */ +public interface Certificates { + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of all certificates in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| subject | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| thumbprint | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| expirationDate | filter | ge, le, eq, ne, gt, lt | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only certificates entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Certificates list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context); + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String certificateId); + + /** + * Gets the entity state (Etag) version of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the certificate specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context); + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + CertificateContract get(String resourceGroupName, String serviceName, String certificateId); + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context); + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String certificateId, String ifMatch); + + /** + * Deletes specific certificate. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String certificateId, String ifMatch, Context context); + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + CertificateContract refreshSecret(String resourceGroupName, String serviceName, String certificateId); + + /** + * From KeyVault, Refresh the certificate being used for authentication with the backend. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate details. + */ + Response refreshSecretWithResponse( + String resourceGroupName, String serviceName, String certificateId, Context context); + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + CertificateContract getById(String id); + + /** + * Gets the details of the certificate specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the certificate specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific certificate. + * + * @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 specific certificate. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new CertificateContract resource. + * + * @param name resource name. + * @return the first stage of the new CertificateContract definition. + */ + CertificateContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..2ce094360d9a2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateHeaders.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.apimanagement.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 CertificatesCreateOrUpdateHeaders model. */ +@Fluent +public final class CertificatesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CertificatesCreateOrUpdateHeaders object itself. + */ + public CertificatesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..a2293bf1a29ef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class CertificatesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of CertificatesCreateOrUpdateResponse. + * + * @param request the request which resulted in this CertificatesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CertificatesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CertificateContractInner value, + CertificatesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CertificateContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..6cb7f6d9abef6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagHeaders.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.apimanagement.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 CertificatesGetEntityTagHeaders model. */ +@Fluent +public final class CertificatesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CertificatesGetEntityTagHeaders object itself. + */ + public CertificatesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagResponse.java new file mode 100644 index 0000000000000..7802386ec6fca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class CertificatesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of CertificatesGetEntityTagResponse. + * + * @param request the request which resulted in this CertificatesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CertificatesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + CertificatesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetHeaders.java new file mode 100644 index 0000000000000..1259fe7dc7ed4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetHeaders.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.apimanagement.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 CertificatesGetHeaders model. */ +@Fluent +public final class CertificatesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CertificatesGetHeaders object itself. + */ + public CertificatesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetResponse.java new file mode 100644 index 0000000000000..2dea0081cedc7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; + +/** Contains all response data for the get operation. */ +public final class CertificatesGetResponse extends ResponseBase { + /** + * Creates an instance of CertificatesGetResponse. + * + * @param request the request which resulted in this CertificatesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CertificatesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CertificateContractInner value, + CertificatesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CertificateContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretHeaders.java new file mode 100644 index 0000000000000..b63be67db2717 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretHeaders.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.apimanagement.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 CertificatesRefreshSecretHeaders model. */ +@Fluent +public final class CertificatesRefreshSecretHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatesRefreshSecretHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the CertificatesRefreshSecretHeaders object itself. + */ + public CertificatesRefreshSecretHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretResponse.java new file mode 100644 index 0000000000000..7890b7769d699 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/CertificatesRefreshSecretResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.CertificateContractInner; + +/** Contains all response data for the refreshSecret operation. */ +public final class CertificatesRefreshSecretResponse + extends ResponseBase { + /** + * Creates an instance of CertificatesRefreshSecretResponse. + * + * @param request the request which resulted in this CertificatesRefreshSecretResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CertificatesRefreshSecretResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CertificateContractInner value, + CertificatesRefreshSecretHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CertificateContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientAuthenticationMethod.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientAuthenticationMethod.java new file mode 100644 index 0000000000000..c82d5e3de18e6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientAuthenticationMethod.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClientAuthenticationMethod. */ +public final class ClientAuthenticationMethod extends ExpandableStringEnum { + /** Static value Basic for ClientAuthenticationMethod. */ + public static final ClientAuthenticationMethod BASIC = fromString("Basic"); + + /** Static value Body for ClientAuthenticationMethod. */ + public static final ClientAuthenticationMethod BODY = fromString("Body"); + + /** + * Creates or finds a ClientAuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClientAuthenticationMethod. + */ + @JsonCreator + public static ClientAuthenticationMethod fromString(String name) { + return fromString(name, ClientAuthenticationMethod.class); + } + + /** @return known ClientAuthenticationMethod values. */ + public static Collection values() { + return values(ClientAuthenticationMethod.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientSecretContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientSecretContract.java new file mode 100644 index 0000000000000..9410ca0bf8612 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ClientSecretContract.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; + +/** An immutable client-side representation of ClientSecretContract. */ +public interface ClientSecretContract { + /** + * Gets the clientSecret property: Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + * + * @return the clientSecret value. + */ + String clientSecret(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner object. + * + * @return the inner object. + */ + ClientSecretContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConfigurationIdName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConfigurationIdName.java new file mode 100644 index 0000000000000..d126aca9157ed --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConfigurationIdName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfigurationIdName. */ +public final class ConfigurationIdName extends ExpandableStringEnum { + /** Static value configuration for ConfigurationIdName. */ + public static final ConfigurationIdName CONFIGURATION = fromString("configuration"); + + /** + * Creates or finds a ConfigurationIdName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationIdName. + */ + @JsonCreator + public static ConfigurationIdName fromString(String name) { + return fromString(name, ConfigurationIdName.class); + } + + /** @return known ConfigurationIdName values. */ + public static Collection values() { + return values(ConfigurationIdName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Confirmation.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Confirmation.java new file mode 100644 index 0000000000000..441945077d995 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Confirmation.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Confirmation. */ +public final class Confirmation extends ExpandableStringEnum { + /** Static value signup for Confirmation. */ + public static final Confirmation SIGNUP = fromString("signup"); + + /** Static value invite for Confirmation. */ + public static final Confirmation INVITE = fromString("invite"); + + /** + * Creates or finds a Confirmation from its string representation. + * + * @param name a name to look for. + * @return the corresponding Confirmation. + */ + @JsonCreator + public static Confirmation fromString(String name) { + return fromString(name, Confirmation.class); + } + + /** @return known Confirmation values. */ + public static Collection values() { + return values(Confirmation.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusContract.java new file mode 100644 index 0000000000000..713323554a64e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusContract.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Details about connectivity to a resource. */ +@Fluent +public final class ConnectivityStatusContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityStatusContract.class); + + /* + * The hostname of the resource which the service depends on. This can be + * the database, storage or any other azure resource on which the service + * depends upon. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Resource Connectivity Status Type identifier. + */ + @JsonProperty(value = "status", required = true) + private ConnectivityStatusType status; + + /* + * Error details of the connectivity to the resource. + */ + @JsonProperty(value = "error") + private String error; + + /* + * The date when the resource connectivity status was last updated. This + * status should be updated every 15 minutes. If this status has not been + * updated, then it means that the service has lost network connectivity to + * the resource, from inside the Virtual Network.The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + */ + @JsonProperty(value = "lastUpdated", required = true) + private OffsetDateTime lastUpdated; + + /* + * The date when the resource connectivity status last Changed from success + * to failure or vice-versa. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "lastStatusChange", required = true) + private OffsetDateTime lastStatusChange; + + /* + * Resource Type. + */ + @JsonProperty(value = "resourceType", required = true) + private String resourceType; + + /* + * Whether this is optional. + */ + @JsonProperty(value = "isOptional", required = true) + private boolean isOptional; + + /** + * Get the name property: The hostname of the resource which the service depends on. This can be the database, + * storage or any other azure resource on which the service depends upon. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The hostname of the resource which the service depends on. This can be the database, + * storage or any other azure resource on which the service depends upon. + * + * @param name the name value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Resource Connectivity Status Type identifier. + * + * @return the status value. + */ + public ConnectivityStatusType status() { + return this.status; + } + + /** + * Set the status property: Resource Connectivity Status Type identifier. + * + * @param status the status value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withStatus(ConnectivityStatusType status) { + this.status = status; + return this; + } + + /** + * Get the error property: Error details of the connectivity to the resource. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: Error details of the connectivity to the resource. + * + * @param error the error value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withError(String error) { + this.error = error; + return this; + } + + /** + * Get the lastUpdated property: The date when the resource connectivity status was last updated. This status should + * be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network + * connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: The date when the resource connectivity status was last updated. This status should + * be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network + * connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param lastUpdated the lastUpdated value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the lastStatusChange property: The date when the resource connectivity status last Changed from success to + * failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + * 8601 standard. + * + * @return the lastStatusChange value. + */ + public OffsetDateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Set the lastStatusChange property: The date when the resource connectivity status last Changed from success to + * failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO + * 8601 standard. + * + * @param lastStatusChange the lastStatusChange value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withLastStatusChange(OffsetDateTime lastStatusChange) { + this.lastStatusChange = lastStatusChange; + return this; + } + + /** + * Get the resourceType property: Resource Type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource Type. + * + * @param resourceType the resourceType value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the isOptional property: Whether this is optional. + * + * @return the isOptional value. + */ + public boolean isOptional() { + return this.isOptional; + } + + /** + * Set the isOptional property: Whether this is optional. + * + * @param isOptional the isOptional value to set. + * @return the ConnectivityStatusContract object itself. + */ + public ConnectivityStatusContract withIsOptional(boolean isOptional) { + this.isOptional = isOptional; + 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 ConnectivityStatusContract")); + } + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model ConnectivityStatusContract")); + } + if (lastUpdated() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lastUpdated in model ConnectivityStatusContract")); + } + if (lastStatusChange() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lastStatusChange in model ConnectivityStatusContract")); + } + if (resourceType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceType in model ConnectivityStatusContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusType.java new file mode 100644 index 0000000000000..fc087f6afbe1e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ConnectivityStatusType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectivityStatusType. */ +public final class ConnectivityStatusType extends ExpandableStringEnum { + /** Static value initializing for ConnectivityStatusType. */ + public static final ConnectivityStatusType INITIALIZING = fromString("initializing"); + + /** Static value success for ConnectivityStatusType. */ + public static final ConnectivityStatusType SUCCESS = fromString("success"); + + /** Static value failure for ConnectivityStatusType. */ + public static final ConnectivityStatusType FAILURE = fromString("failure"); + + /** + * Creates or finds a ConnectivityStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityStatusType. + */ + @JsonCreator + public static ConnectivityStatusType fromString(String name) { + return fromString(name, ConnectivityStatusType.class); + } + + /** @return known ConnectivityStatusType values. */ + public static Collection values() { + return values(ConnectivityStatusType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentFormat.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentFormat.java new file mode 100644 index 0000000000000..a7ee137b85a3e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentFormat.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentFormat. */ +public final class ContentFormat extends ExpandableStringEnum { + /** Static value wadl-xml for ContentFormat. */ + public static final ContentFormat WADL_XML = fromString("wadl-xml"); + + /** Static value wadl-link-json for ContentFormat. */ + public static final ContentFormat WADL_LINK_JSON = fromString("wadl-link-json"); + + /** Static value swagger-json for ContentFormat. */ + public static final ContentFormat SWAGGER_JSON = fromString("swagger-json"); + + /** Static value swagger-link-json for ContentFormat. */ + public static final ContentFormat SWAGGER_LINK_JSON = fromString("swagger-link-json"); + + /** Static value wsdl for ContentFormat. */ + public static final ContentFormat WSDL = fromString("wsdl"); + + /** Static value wsdl-link for ContentFormat. */ + public static final ContentFormat WSDL_LINK = fromString("wsdl-link"); + + /** Static value openapi for ContentFormat. */ + public static final ContentFormat OPENAPI = fromString("openapi"); + + /** Static value openapi+json for ContentFormat. */ + public static final ContentFormat OPENAPI_JSON = fromString("openapi+json"); + + /** Static value openapi-link for ContentFormat. */ + public static final ContentFormat OPENAPI_LINK = fromString("openapi-link"); + + /** Static value openapi+json-link for ContentFormat. */ + public static final ContentFormat OPENAPI_JSON_LINK = fromString("openapi+json-link"); + + /** + * Creates or finds a ContentFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentFormat. + */ + @JsonCreator + public static ContentFormat fromString(String name) { + return fromString(name, ContentFormat.class); + } + + /** @return known ContentFormat values. */ + public static Collection values() { + return values(ContentFormat.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemCollection.java new file mode 100644 index 0000000000000..e52a141165ea8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of content items. */ +@Immutable +public final class ContentItemCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentItemCollection.class); + + /* + * Collection of content items. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link, if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of content items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemContract.java new file mode 100644 index 0000000000000..8b877eeb6a668 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; +import java.util.Map; + +/** An immutable client-side representation of ContentItemContract. */ +public interface ContentItemContract { + /** + * 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 properties property: Properties of the content item. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner object. + * + * @return the inner object. + */ + ContentItemContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItems.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItems.java new file mode 100644 index 0000000000000..efb1037922e0e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItems.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ContentItems. */ +public interface ContentItems { + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId); + + /** + * Returns list of content items. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content items. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String contentTypeId, Context context); + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String contentTypeId, String contentItemId); + + /** + * Returns content item metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context); + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + ContentItemContract get(String resourceGroupName, String serviceName, String contentTypeId, String contentItemId); + + /** + * Returns content item details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId, Context context); + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + ContentItemContract createOrUpdate( + String resourceGroupName, String serviceName, String contentTypeId, String contentItemId); + + /** + * Creates new content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context); + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String contentTypeId, String contentItemId, String ifMatch); + + /** + * Removes specified content item. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param contentItemId Content item identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String contentTypeId, + String contentItemId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..cd6a72cdacde2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateHeaders.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.apimanagement.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 ContentItemsCreateOrUpdateHeaders model. */ +@Fluent +public final class ContentItemsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentItemsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ContentItemsCreateOrUpdateHeaders object itself. + */ + public ContentItemsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..09a623e4e9791 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ContentItemsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ContentItemsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ContentItemsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ContentItemsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ContentItemContractInner value, + ContentItemsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ContentItemContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..9192f7b768185 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagHeaders.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.apimanagement.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 ContentItemsGetEntityTagHeaders model. */ +@Fluent +public final class ContentItemsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentItemsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ContentItemsGetEntityTagHeaders object itself. + */ + public ContentItemsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagResponse.java new file mode 100644 index 0000000000000..801bac1f29fb6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ContentItemsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ContentItemsGetEntityTagResponse. + * + * @param request the request which resulted in this ContentItemsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ContentItemsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ContentItemsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetHeaders.java new file mode 100644 index 0000000000000..a888212f4a5c6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetHeaders.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.apimanagement.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 ContentItemsGetHeaders model. */ +@Fluent +public final class ContentItemsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentItemsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ContentItemsGetHeaders object itself. + */ + public ContentItemsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetResponse.java new file mode 100644 index 0000000000000..95d9e57779ecc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentItemsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentItemContractInner; + +/** Contains all response data for the get operation. */ +public final class ContentItemsGetResponse extends ResponseBase { + /** + * Creates an instance of ContentItemsGetResponse. + * + * @param request the request which resulted in this ContentItemsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ContentItemsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ContentItemContractInner value, + ContentItemsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ContentItemContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeCollection.java new file mode 100644 index 0000000000000..ad3829a3dc7cb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of content types. */ +@Immutable +public final class ContentTypeCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentTypeCollection.class); + + /* + * Collection of content types. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link, if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of content types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeContract.java new file mode 100644 index 0000000000000..fe75ef7386a19 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypeContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; + +/** An immutable client-side representation of ContentTypeContract. */ +public interface ContentTypeContract { + /** + * 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 idPropertiesId property: Content type identifier. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the namePropertiesName property: Content type name. Must be 1 to 250 characters long. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the description property: Content type description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the schema property: Content type schema. + * + * @return the schema value. + */ + Object schema(); + + /** + * Gets the version property: Content type version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner object. + * + * @return the inner object. + */ + ContentTypeContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypes.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypes.java new file mode 100644 index 0000000000000..201a5f0cae4c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypes.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 ContentTypes. */ +public interface ContentTypes { + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Returns list of content types. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of content types. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, Context context); + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + ContentTypeContract get(String resourceGroupName, String serviceName, String contentTypeId); + + /** + * Gets API Management content type details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management content type details. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, Context context); + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + ContentTypeContract createOrUpdate(String resourceGroupName, String serviceName, String contentTypeId); + + /** + * Creates or updates an Content Type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return content type contract details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context); + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String contentTypeId, String ifMatch); + + /** + * Removes specified content type. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param contentTypeId Content type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String contentTypeId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..22aa02c2484ca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateHeaders.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.apimanagement.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 ContentTypesCreateOrUpdateHeaders model. */ +@Fluent +public final class ContentTypesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentTypesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ContentTypesCreateOrUpdateHeaders object itself. + */ + public ContentTypesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..dab0c48077074 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ContentTypesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ContentTypesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ContentTypesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ContentTypesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ContentTypeContractInner value, + ContentTypesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ContentTypeContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetHeaders.java new file mode 100644 index 0000000000000..f77c48c0804f7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetHeaders.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.apimanagement.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 ContentTypesGetHeaders model. */ +@Fluent +public final class ContentTypesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentTypesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ContentTypesGetHeaders object itself. + */ + public ContentTypesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetResponse.java new file mode 100644 index 0000000000000..538f3ba77f1fb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ContentTypesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ContentTypeContractInner; + +/** Contains all response data for the get operation. */ +public final class ContentTypesGetResponse extends ResponseBase { + /** + * Creates an instance of ContentTypesGetResponse. + * + * @param request the request which resulted in this ContentTypesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ContentTypesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ContentTypeContractInner value, + ContentTypesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ContentTypeContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMasking.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMasking.java new file mode 100644 index 0000000000000..e51f95be63eef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMasking.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.apimanagement.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 DataMasking model. */ +@Fluent +public final class DataMasking { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMasking.class); + + /* + * Masking settings for Url query parameters + */ + @JsonProperty(value = "queryParams") + private List queryParams; + + /* + * Masking settings for headers + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Get the queryParams property: Masking settings for Url query parameters. + * + * @return the queryParams value. + */ + public List queryParams() { + return this.queryParams; + } + + /** + * Set the queryParams property: Masking settings for Url query parameters. + * + * @param queryParams the queryParams value to set. + * @return the DataMasking object itself. + */ + public DataMasking withQueryParams(List queryParams) { + this.queryParams = queryParams; + return this; + } + + /** + * Get the headers property: Masking settings for headers. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: Masking settings for headers. + * + * @param headers the headers value to set. + * @return the DataMasking object itself. + */ + public DataMasking withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryParams() != null) { + queryParams().forEach(e -> e.validate()); + } + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingEntity.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingEntity.java new file mode 100644 index 0000000000000..e9971a9a2eeba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingEntity.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.apimanagement.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 DataMaskingEntity model. */ +@Fluent +public final class DataMaskingEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMaskingEntity.class); + + /* + * The name of an entity to mask (e.g. a name of a header or a query + * parameter). + */ + @JsonProperty(value = "value") + private String value; + + /* + * Data masking mode. + */ + @JsonProperty(value = "mode") + private DataMaskingMode mode; + + /** + * Get the value property: The name of an entity to mask (e.g. a name of a header or a query parameter). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The name of an entity to mask (e.g. a name of a header or a query parameter). + * + * @param value the value value to set. + * @return the DataMaskingEntity object itself. + */ + public DataMaskingEntity withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the mode property: Data masking mode. + * + * @return the mode value. + */ + public DataMaskingMode mode() { + return this.mode; + } + + /** + * Set the mode property: Data masking mode. + * + * @param mode the mode value to set. + * @return the DataMaskingEntity object itself. + */ + public DataMaskingEntity withMode(DataMaskingMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingMode.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingMode.java new file mode 100644 index 0000000000000..7f994ef067b92 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DataMaskingMode.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataMaskingMode. */ +public final class DataMaskingMode extends ExpandableStringEnum { + /** Static value Mask for DataMaskingMode. */ + public static final DataMaskingMode MASK = fromString("Mask"); + + /** Static value Hide for DataMaskingMode. */ + public static final DataMaskingMode HIDE = fromString("Hide"); + + /** + * Creates or finds a DataMaskingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataMaskingMode. + */ + @JsonCreator + public static DataMaskingMode fromString(String name) { + return fromString(name, DataMaskingMode.class); + } + + /** @return known DataMaskingMode values. */ + public static Collection values() { + return values(DataMaskingMode.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettings.java new file mode 100644 index 0000000000000..3ac41fd30863d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettings.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner; + +/** Resource collection API of DelegationSettings. */ +public interface DelegationSettings { + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName); + + /** + * Gets the entity state (Etag) version of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the DelegationSettings. + */ + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + PortalDelegationSettings get(String resourceGroupName, String serviceName); + + /** + * Get Delegation Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation Settings for the Portal. + */ + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String serviceName, String ifMatch, PortalDelegationSettingsInner parameters); + + /** + * Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Delegation settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalDelegationSettingsInner parameters, + Context context); + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + PortalDelegationSettings createOrUpdate( + String resourceGroupName, String serviceName, PortalDelegationSettingsInner parameters); + + /** + * Create or Update Delegation settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return delegation settings for a developer portal. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalDelegationSettingsInner parameters, + String ifMatch, + Context context); + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + PortalSettingValidationKeyContract listSecrets(String resourceGroupName, String serviceName); + + /** + * Gets the secret validation key of the DelegationSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret validation key of the DelegationSettings. + */ + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..8d3fed579dfb0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagHeaders.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.apimanagement.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 DelegationSettingsGetEntityTagHeaders model. */ +@Fluent +public final class DelegationSettingsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegationSettingsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the DelegationSettingsGetEntityTagHeaders object itself. + */ + public DelegationSettingsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagResponse.java new file mode 100644 index 0000000000000..b0276621dcb97 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class DelegationSettingsGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of DelegationSettingsGetEntityTagResponse. + * + * @param request the request which resulted in this DelegationSettingsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DelegationSettingsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + DelegationSettingsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetHeaders.java new file mode 100644 index 0000000000000..be8ac150f2f64 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetHeaders.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.apimanagement.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 DelegationSettingsGetHeaders model. */ +@Fluent +public final class DelegationSettingsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegationSettingsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the DelegationSettingsGetHeaders object itself. + */ + public DelegationSettingsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetResponse.java new file mode 100644 index 0000000000000..c0aaec0baafad --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DelegationSettingsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner; + +/** Contains all response data for the get operation. */ +public final class DelegationSettingsGetResponse + extends ResponseBase { + /** + * Creates an instance of DelegationSettingsGetResponse. + * + * @param request the request which resulted in this DelegationSettingsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DelegationSettingsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PortalDelegationSettingsInner value, + DelegationSettingsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PortalDelegationSettingsInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServiceContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServiceContract.java new file mode 100644 index 0000000000000..cfa3e500e1f6e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServiceContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.DeletedServiceContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of DeletedServiceContract. */ +public interface DeletedServiceContract { + /** + * 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: Api Management Service Master Location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the serviceId property: Fully-qualified API Management Service Resource ID. + * + * @return the serviceId value. + */ + String serviceId(); + + /** + * Gets the scheduledPurgeDate property: UTC Date and Time when the service will be automatically purged. The date + * conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the scheduledPurgeDate value. + */ + OffsetDateTime scheduledPurgeDate(); + + /** + * Gets the deletionDate property: UTC Timestamp when the service was soft-deleted. The date conforms to the + * following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + * + * @return the deletionDate value. + */ + OffsetDateTime deletionDate(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.DeletedServiceContractInner object. + * + * @return the inner object. + */ + DeletedServiceContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServices.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServices.java new file mode 100644 index 0000000000000..c25de575ab3d1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServices.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.apimanagement.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 DeletedServices. */ +public interface DeletedServices { + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + PagedIterable list(); + + /** + * Lists all soft-deleted services available for undelete for the given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged deleted Api Management Services List Representation. + */ + PagedIterable list(Context context); + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + DeletedServiceContract getByName(String serviceName, String location); + + /** + * Get soft-deleted Api Management Service by name. + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return soft-deleted Api Management Service by name. + */ + Response getByNameWithResponse(String serviceName, String location, Context context); + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + DeletedServiceContract purge(String serviceName, String location); + + /** + * Purges Api Management Service (deletes it with no option to undelete). + * + * @param serviceName The name of the API Management service. + * @param location The location of the deleted API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + DeletedServiceContract purge(String serviceName, String location, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServicesCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServicesCollection.java new file mode 100644 index 0000000000000..dd8446aedc55f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeletedServicesCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.DeletedServiceContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged deleted Api Management Services List Representation. */ +@Immutable +public final class DeletedServicesCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedServicesCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeployConfigurationParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeployConfigurationParameters.java new file mode 100644 index 0000000000000..e520612339c03 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DeployConfigurationParameters.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.apimanagement.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; + +/** Deploy Tenant Configuration Contract. */ +@JsonFlatten +@Fluent +public class DeployConfigurationParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeployConfigurationParameters.class); + + /* + * The name of the Git branch from which the configuration is to be + * deployed to the configuration database. + */ + @JsonProperty(value = "properties.branch") + private String branch; + + /* + * The value enforcing deleting subscriptions to products that are deleted + * in this update. + */ + @JsonProperty(value = "properties.force") + private Boolean force; + + /** + * Get the branch property: The name of the Git branch from which the configuration is to be deployed to the + * configuration database. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The name of the Git branch from which the configuration is to be deployed to the + * configuration database. + * + * @param branch the branch value to set. + * @return the DeployConfigurationParameters object itself. + */ + public DeployConfigurationParameters withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the force property: The value enforcing deleting subscriptions to products that are deleted in this update. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: The value enforcing deleting subscriptions to products that are deleted in this update. + * + * @param force the force value to set. + * @return the DeployConfigurationParameters object itself. + */ + public DeployConfigurationParameters withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticCollection.java new file mode 100644 index 0000000000000..166242e94bba0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Diagnostic list representation. */ +@Fluent +public final class DiagnosticCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the DiagnosticCollection object itself. + */ + public DiagnosticCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the DiagnosticCollection object itself. + */ + public DiagnosticCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the DiagnosticCollection object itself. + */ + public DiagnosticCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticContract.java new file mode 100644 index 0000000000000..c73341c30938e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticContract.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** An immutable client-side representation of DiagnosticContract. */ +public interface DiagnosticContract { + /** + * 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 alwaysLog property: Specifies for what type of messages sampling settings should not apply. + * + * @return the alwaysLog value. + */ + AlwaysLog alwaysLog(); + + /** + * Gets the loggerId property: Resource Id of a target logger. + * + * @return the loggerId value. + */ + String loggerId(); + + /** + * Gets the sampling property: Sampling settings for Diagnostic. + * + * @return the sampling value. + */ + SamplingSettings sampling(); + + /** + * Gets the frontend property: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + * + * @return the frontend value. + */ + PipelineDiagnosticSettings frontend(); + + /** + * Gets the backend property: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * + * @return the backend value. + */ + PipelineDiagnosticSettings backend(); + + /** + * Gets the logClientIp property: Log the ClientIP. Default is false. + * + * @return the logClientIp value. + */ + Boolean logClientIp(); + + /** + * Gets the httpCorrelationProtocol property: Sets correlation protocol to use for Application Insights diagnostics. + * + * @return the httpCorrelationProtocol value. + */ + HttpCorrelationProtocol httpCorrelationProtocol(); + + /** + * Gets the verbosity property: The verbosity level applied to traces emitted by trace policies. + * + * @return the verbosity value. + */ + Verbosity verbosity(); + + /** + * Gets the operationNameFormat property: The format of the Operation Name for Application Insights telemetries. + * Default is Name. + * + * @return the operationNameFormat value. + */ + OperationNameFormat operationNameFormat(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner object. + * + * @return the inner object. + */ + DiagnosticContractInner innerModel(); + + /** The entirety of the DiagnosticContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DiagnosticContract definition stages. */ + interface DefinitionStages { + /** The first stage of the DiagnosticContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DiagnosticContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @return the next definition stage. + */ + WithCreate withExistingApi(String resourceGroupName, String serviceName, String apiId); + } + /** + * The stage of the DiagnosticContract 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.WithAlwaysLog, + DefinitionStages.WithLoggerId, + DefinitionStages.WithSampling, + DefinitionStages.WithFrontend, + DefinitionStages.WithBackend, + DefinitionStages.WithLogClientIp, + DefinitionStages.WithHttpCorrelationProtocol, + DefinitionStages.WithVerbosity, + DefinitionStages.WithOperationNameFormat, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + DiagnosticContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DiagnosticContract create(Context context); + } + /** The stage of the DiagnosticContract definition allowing to specify alwaysLog. */ + interface WithAlwaysLog { + /** + * Specifies the alwaysLog property: Specifies for what type of messages sampling settings should not + * apply.. + * + * @param alwaysLog Specifies for what type of messages sampling settings should not apply. + * @return the next definition stage. + */ + WithCreate withAlwaysLog(AlwaysLog alwaysLog); + } + /** The stage of the DiagnosticContract definition allowing to specify loggerId. */ + interface WithLoggerId { + /** + * Specifies the loggerId property: Resource Id of a target logger.. + * + * @param loggerId Resource Id of a target logger. + * @return the next definition stage. + */ + WithCreate withLoggerId(String loggerId); + } + /** The stage of the DiagnosticContract definition allowing to specify sampling. */ + interface WithSampling { + /** + * Specifies the sampling property: Sampling settings for Diagnostic.. + * + * @param sampling Sampling settings for Diagnostic. + * @return the next definition stage. + */ + WithCreate withSampling(SamplingSettings sampling); + } + /** The stage of the DiagnosticContract definition allowing to specify frontend. */ + interface WithFrontend { + /** + * Specifies the frontend property: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.. + * + * @param frontend Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + * @return the next definition stage. + */ + WithCreate withFrontend(PipelineDiagnosticSettings frontend); + } + /** The stage of the DiagnosticContract definition allowing to specify backend. */ + interface WithBackend { + /** + * Specifies the backend property: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * + * @param backend Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * @return the next definition stage. + */ + WithCreate withBackend(PipelineDiagnosticSettings backend); + } + /** The stage of the DiagnosticContract definition allowing to specify logClientIp. */ + interface WithLogClientIp { + /** + * Specifies the logClientIp property: Log the ClientIP. Default is false.. + * + * @param logClientIp Log the ClientIP. Default is false. + * @return the next definition stage. + */ + WithCreate withLogClientIp(Boolean logClientIp); + } + /** The stage of the DiagnosticContract definition allowing to specify httpCorrelationProtocol. */ + interface WithHttpCorrelationProtocol { + /** + * Specifies the httpCorrelationProtocol property: Sets correlation protocol to use for Application Insights + * diagnostics.. + * + * @param httpCorrelationProtocol Sets correlation protocol to use for Application Insights diagnostics. + * @return the next definition stage. + */ + WithCreate withHttpCorrelationProtocol(HttpCorrelationProtocol httpCorrelationProtocol); + } + /** The stage of the DiagnosticContract definition allowing to specify verbosity. */ + interface WithVerbosity { + /** + * Specifies the verbosity property: The verbosity level applied to traces emitted by trace policies.. + * + * @param verbosity The verbosity level applied to traces emitted by trace policies. + * @return the next definition stage. + */ + WithCreate withVerbosity(Verbosity verbosity); + } + /** The stage of the DiagnosticContract definition allowing to specify operationNameFormat. */ + interface WithOperationNameFormat { + /** + * Specifies the operationNameFormat property: The format of the Operation Name for Application Insights + * telemetries. Default is Name.. + * + * @param operationNameFormat The format of the Operation Name for Application Insights telemetries. Default + * is Name. + * @return the next definition stage. + */ + WithCreate withOperationNameFormat(OperationNameFormat operationNameFormat); + } + /** The stage of the DiagnosticContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the DiagnosticContract resource. + * + * @return the stage of resource update. + */ + DiagnosticContract.Update update(); + + /** The template for DiagnosticContract update. */ + interface Update + extends UpdateStages.WithAlwaysLog, + UpdateStages.WithLoggerId, + UpdateStages.WithSampling, + UpdateStages.WithFrontend, + UpdateStages.WithBackend, + UpdateStages.WithLogClientIp, + UpdateStages.WithHttpCorrelationProtocol, + UpdateStages.WithVerbosity, + UpdateStages.WithOperationNameFormat, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DiagnosticContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DiagnosticContract apply(Context context); + } + /** The DiagnosticContract update stages. */ + interface UpdateStages { + /** The stage of the DiagnosticContract update allowing to specify alwaysLog. */ + interface WithAlwaysLog { + /** + * Specifies the alwaysLog property: Specifies for what type of messages sampling settings should not + * apply.. + * + * @param alwaysLog Specifies for what type of messages sampling settings should not apply. + * @return the next definition stage. + */ + Update withAlwaysLog(AlwaysLog alwaysLog); + } + /** The stage of the DiagnosticContract update allowing to specify loggerId. */ + interface WithLoggerId { + /** + * Specifies the loggerId property: Resource Id of a target logger.. + * + * @param loggerId Resource Id of a target logger. + * @return the next definition stage. + */ + Update withLoggerId(String loggerId); + } + /** The stage of the DiagnosticContract update allowing to specify sampling. */ + interface WithSampling { + /** + * Specifies the sampling property: Sampling settings for Diagnostic.. + * + * @param sampling Sampling settings for Diagnostic. + * @return the next definition stage. + */ + Update withSampling(SamplingSettings sampling); + } + /** The stage of the DiagnosticContract update allowing to specify frontend. */ + interface WithFrontend { + /** + * Specifies the frontend property: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.. + * + * @param frontend Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + * @return the next definition stage. + */ + Update withFrontend(PipelineDiagnosticSettings frontend); + } + /** The stage of the DiagnosticContract update allowing to specify backend. */ + interface WithBackend { + /** + * Specifies the backend property: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * + * @param backend Diagnostic settings for incoming/outgoing HTTP messages to the Backend. + * @return the next definition stage. + */ + Update withBackend(PipelineDiagnosticSettings backend); + } + /** The stage of the DiagnosticContract update allowing to specify logClientIp. */ + interface WithLogClientIp { + /** + * Specifies the logClientIp property: Log the ClientIP. Default is false.. + * + * @param logClientIp Log the ClientIP. Default is false. + * @return the next definition stage. + */ + Update withLogClientIp(Boolean logClientIp); + } + /** The stage of the DiagnosticContract update allowing to specify httpCorrelationProtocol. */ + interface WithHttpCorrelationProtocol { + /** + * Specifies the httpCorrelationProtocol property: Sets correlation protocol to use for Application Insights + * diagnostics.. + * + * @param httpCorrelationProtocol Sets correlation protocol to use for Application Insights diagnostics. + * @return the next definition stage. + */ + Update withHttpCorrelationProtocol(HttpCorrelationProtocol httpCorrelationProtocol); + } + /** The stage of the DiagnosticContract update allowing to specify verbosity. */ + interface WithVerbosity { + /** + * Specifies the verbosity property: The verbosity level applied to traces emitted by trace policies.. + * + * @param verbosity The verbosity level applied to traces emitted by trace policies. + * @return the next definition stage. + */ + Update withVerbosity(Verbosity verbosity); + } + /** The stage of the DiagnosticContract update allowing to specify operationNameFormat. */ + interface WithOperationNameFormat { + /** + * Specifies the operationNameFormat property: The format of the Operation Name for Application Insights + * telemetries. Default is Name.. + * + * @param operationNameFormat The format of the Operation Name for Application Insights telemetries. Default + * is Name. + * @return the next definition stage. + */ + Update withOperationNameFormat(OperationNameFormat operationNameFormat); + } + /** The stage of the DiagnosticContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DiagnosticContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DiagnosticContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Diagnostics.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Diagnostics.java new file mode 100644 index 0000000000000..d4f32dc4cc757 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Diagnostics.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Resource collection API of Diagnostics. */ +public interface Diagnostics { + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists all diagnostics of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Diagnostic list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String diagnosticId); + + /** + * Gets the entity state (Etag) version of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Diagnostic specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context); + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + DiagnosticContract get(String resourceGroupName, String serviceName, String diagnosticId); + + /** + * Gets the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Diagnostic specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, Context context); + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + DiagnosticContract createOrUpdate( + String resourceGroupName, String serviceName, String diagnosticId, DiagnosticContractInner parameters); + + /** + * Creates a new Diagnostic or updates an existing one. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param parameters Create parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + DiagnosticContractInner parameters, + String ifMatch, + Context context); + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + DiagnosticContract update( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters); + + /** + * Updates the details of the Diagnostic specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Diagnostic Update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostic details. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String diagnosticId, + String ifMatch, + DiagnosticContractInner parameters, + Context context); + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String diagnosticId, String ifMatch); + + /** + * Deletes the specified Diagnostic. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param diagnosticId Diagnostic identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String diagnosticId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..8f8a83f7eceaa --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateHeaders.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.apimanagement.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 DiagnosticsCreateOrUpdateHeaders model. */ +@Fluent +public final class DiagnosticsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the DiagnosticsCreateOrUpdateHeaders object itself. + */ + public DiagnosticsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..9f0b8865fd72d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class DiagnosticsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of DiagnosticsCreateOrUpdateResponse. + * + * @param request the request which resulted in this DiagnosticsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DiagnosticsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + DiagnosticContractInner value, + DiagnosticsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public DiagnosticContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..391bb6317c6f7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagHeaders.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.apimanagement.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 DiagnosticsGetEntityTagHeaders model. */ +@Fluent +public final class DiagnosticsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the DiagnosticsGetEntityTagHeaders object itself. + */ + public DiagnosticsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagResponse.java new file mode 100644 index 0000000000000..b3e07006dc103 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class DiagnosticsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of DiagnosticsGetEntityTagResponse. + * + * @param request the request which resulted in this DiagnosticsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DiagnosticsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + DiagnosticsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetHeaders.java new file mode 100644 index 0000000000000..909a3090cdf64 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetHeaders.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.apimanagement.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 DiagnosticsGetHeaders model. */ +@Fluent +public final class DiagnosticsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the DiagnosticsGetHeaders object itself. + */ + public DiagnosticsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetResponse.java new file mode 100644 index 0000000000000..dd7af80ebf128 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Contains all response data for the get operation. */ +public final class DiagnosticsGetResponse extends ResponseBase { + /** + * Creates an instance of DiagnosticsGetResponse. + * + * @param request the request which resulted in this DiagnosticsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DiagnosticsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + DiagnosticContractInner value, + DiagnosticsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public DiagnosticContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateHeaders.java new file mode 100644 index 0000000000000..a584399b06563 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateHeaders.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.apimanagement.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 DiagnosticsUpdateHeaders model. */ +@Fluent +public final class DiagnosticsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the DiagnosticsUpdateHeaders object itself. + */ + public DiagnosticsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateResponse.java new file mode 100644 index 0000000000000..3b7c50d52bf80 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/DiagnosticsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.DiagnosticContractInner; + +/** Contains all response data for the update operation. */ +public final class DiagnosticsUpdateResponse extends ResponseBase { + /** + * Creates an instance of DiagnosticsUpdateResponse. + * + * @param request the request which resulted in this DiagnosticsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public DiagnosticsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + DiagnosticContractInner value, + DiagnosticsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public DiagnosticContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateCollection.java new file mode 100644 index 0000000000000..b421b3593275a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged email template list representation. */ +@Fluent +public final class EmailTemplateCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplateCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the EmailTemplateCollection object itself. + */ + public EmailTemplateCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the EmailTemplateCollection object itself. + */ + public EmailTemplateCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the EmailTemplateCollection object itself. + */ + public EmailTemplateCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateContract.java new file mode 100644 index 0000000000000..7ffc1adc566a8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateContract.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; +import java.util.List; + +/** An immutable client-side representation of EmailTemplateContract. */ +public interface EmailTemplateContract { + /** + * 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 subject property: Subject of the Template. + * + * @return the subject value. + */ + String subject(); + + /** + * Gets the body property: Email Template Body. This should be a valid XDocument. + * + * @return the body value. + */ + String body(); + + /** + * Gets the title property: Title of the Template. + * + * @return the title value. + */ + String title(); + + /** + * Gets the description property: Description of the Email Template. + * + * @return the description value. + */ + String description(); + + /** + * Gets the isDefault property: Whether the template is the default template provided by Api Management or has been + * edited. + * + * @return the isDefault value. + */ + Boolean isDefault(); + + /** + * Gets the parameters property: Email Template Parameter values. + * + * @return the parameters value. + */ + List parameters(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner object. + * + * @return the inner object. + */ + EmailTemplateContractInner innerModel(); + + /** The entirety of the EmailTemplateContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The EmailTemplateContract definition stages. */ + interface DefinitionStages { + /** The first stage of the EmailTemplateContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the EmailTemplateContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the EmailTemplateContract 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.WithSubject, + DefinitionStages.WithTitle, + DefinitionStages.WithDescription, + DefinitionStages.WithBody, + DefinitionStages.WithParameters, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + EmailTemplateContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EmailTemplateContract create(Context context); + } + /** The stage of the EmailTemplateContract definition allowing to specify subject. */ + interface WithSubject { + /** + * Specifies the subject property: Subject of the Template.. + * + * @param subject Subject of the Template. + * @return the next definition stage. + */ + WithCreate withSubject(String subject); + } + /** The stage of the EmailTemplateContract definition allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: Title of the Template.. + * + * @param title Title of the Template. + * @return the next definition stage. + */ + WithCreate withTitle(String title); + } + /** The stage of the EmailTemplateContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the Email Template.. + * + * @param description Description of the Email Template. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the EmailTemplateContract definition allowing to specify body. */ + interface WithBody { + /** + * Specifies the body property: Email Template Body. This should be a valid XDocument. + * + * @param body Email Template Body. This should be a valid XDocument. + * @return the next definition stage. + */ + WithCreate withBody(String body); + } + /** The stage of the EmailTemplateContract definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: Email Template Parameter values.. + * + * @param parameters Email Template Parameter values. + * @return the next definition stage. + */ + WithCreate withParameters(List parameters); + } + /** The stage of the EmailTemplateContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the EmailTemplateContract resource. + * + * @return the stage of resource update. + */ + EmailTemplateContract.Update update(); + + /** The template for EmailTemplateContract update. */ + interface Update + extends UpdateStages.WithSubject, + UpdateStages.WithTitle, + UpdateStages.WithDescription, + UpdateStages.WithBody, + UpdateStages.WithParameters, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EmailTemplateContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EmailTemplateContract apply(Context context); + } + /** The EmailTemplateContract update stages. */ + interface UpdateStages { + /** The stage of the EmailTemplateContract update allowing to specify subject. */ + interface WithSubject { + /** + * Specifies the subject property: Subject of the Template.. + * + * @param subject Subject of the Template. + * @return the next definition stage. + */ + Update withSubject(String subject); + } + /** The stage of the EmailTemplateContract update allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: Title of the Template.. + * + * @param title Title of the Template. + * @return the next definition stage. + */ + Update withTitle(String title); + } + /** The stage of the EmailTemplateContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the Email Template.. + * + * @param description Description of the Email Template. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the EmailTemplateContract update allowing to specify body. */ + interface WithBody { + /** + * Specifies the body property: Email Template Body. This should be a valid XDocument. + * + * @param body Email Template Body. This should be a valid XDocument. + * @return the next definition stage. + */ + Update withBody(String body); + } + /** The stage of the EmailTemplateContract update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: Email Template Parameter values.. + * + * @param parameters Email Template Parameter values. + * @return the next definition stage. + */ + Update withParameters(List parameters); + } + /** The stage of the EmailTemplateContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EmailTemplateContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EmailTemplateContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateParametersContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateParametersContractProperties.java new file mode 100644 index 0000000000000..d6b154ff44ae8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateParametersContractProperties.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.apimanagement.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; + +/** Email Template Parameter contract. */ +@Fluent +public final class EmailTemplateParametersContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplateParametersContractProperties.class); + + /* + * Template parameter name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Template parameter title. + */ + @JsonProperty(value = "title") + private String title; + + /* + * Template parameter description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name property: Template parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Template parameter name. + * + * @param name the name value to set. + * @return the EmailTemplateParametersContractProperties object itself. + */ + public EmailTemplateParametersContractProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the title property: Template parameter title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Template parameter title. + * + * @param title the title value to set. + * @return the EmailTemplateParametersContractProperties object itself. + */ + public EmailTemplateParametersContractProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Template parameter description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Template parameter description. + * + * @param description the description value to set. + * @return the EmailTemplateParametersContractProperties object itself. + */ + public EmailTemplateParametersContractProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateUpdateParameters.java new file mode 100644 index 0000000000000..25ee89e0fd3d9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplateUpdateParameters.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Email Template update Parameters. */ +@JsonFlatten +@Fluent +public class EmailTemplateUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplateUpdateParameters.class); + + /* + * Subject of the Template. + */ + @JsonProperty(value = "properties.subject") + private String subject; + + /* + * Title of the Template. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Description of the Email Template. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Email Template Body. This should be a valid XDocument + */ + @JsonProperty(value = "properties.body") + private String body; + + /* + * Email Template Parameter values. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * Get the subject property: Subject of the Template. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject of the Template. + * + * @param subject the subject value to set. + * @return the EmailTemplateUpdateParameters object itself. + */ + public EmailTemplateUpdateParameters withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the title property: Title of the Template. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title of the Template. + * + * @param title the title value to set. + * @return the EmailTemplateUpdateParameters object itself. + */ + public EmailTemplateUpdateParameters withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Description of the Email Template. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the Email Template. + * + * @param description the description value to set. + * @return the EmailTemplateUpdateParameters object itself. + */ + public EmailTemplateUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the body property: Email Template Body. This should be a valid XDocument. + * + * @return the body value. + */ + public String body() { + return this.body; + } + + /** + * Set the body property: Email Template Body. This should be a valid XDocument. + * + * @param body the body value to set. + * @return the EmailTemplateUpdateParameters object itself. + */ + public EmailTemplateUpdateParameters withBody(String body) { + this.body = body; + return this; + } + + /** + * Get the parameters property: Email Template Parameter values. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Email Template Parameter values. + * + * @param parameters the parameters value to set. + * @return the EmailTemplateUpdateParameters object itself. + */ + public EmailTemplateUpdateParameters withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplates.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplates.java new file mode 100644 index 0000000000000..522eabb5f37ab --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplates.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.apimanagement.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 EmailTemplates. */ +public interface EmailTemplates { + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Gets all email templates. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all email templates. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, TemplateName templateName); + + /** + * Gets the entity state (Etag) version of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the email template specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context); + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + EmailTemplateContract get(String resourceGroupName, String serviceName, TemplateName templateName); + + /** + * Gets the details of the email template specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, Context context); + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, TemplateName templateName, String ifMatch); + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param templateName Email Template Name Identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, TemplateName templateName, String ifMatch, Context context); + + /** + * Gets the details of the email template specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + EmailTemplateContract getById(String id); + + /** + * Gets the details of the email template specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the email template specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @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); + + /** + * Reset the Email Template to default template provided by the API Management service instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new EmailTemplateContract resource. + * + * @param name resource name. + * @return the first stage of the new EmailTemplateContract definition. + */ + EmailTemplateContract.DefinitionStages.Blank define(TemplateName name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..adb4a82a79746 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagHeaders.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.apimanagement.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 EmailTemplatesGetEntityTagHeaders model. */ +@Fluent +public final class EmailTemplatesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplatesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the EmailTemplatesGetEntityTagHeaders object itself. + */ + public EmailTemplatesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagResponse.java new file mode 100644 index 0000000000000..bf0f291963073 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class EmailTemplatesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of EmailTemplatesGetEntityTagResponse. + * + * @param request the request which resulted in this EmailTemplatesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public EmailTemplatesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + EmailTemplatesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetHeaders.java new file mode 100644 index 0000000000000..d8ade865e538f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetHeaders.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.apimanagement.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 EmailTemplatesGetHeaders model. */ +@Fluent +public final class EmailTemplatesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplatesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the EmailTemplatesGetHeaders object itself. + */ + public EmailTemplatesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetResponse.java new file mode 100644 index 0000000000000..f4e33318c66e8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; + +/** Contains all response data for the get operation. */ +public final class EmailTemplatesGetResponse + extends ResponseBase { + /** + * Creates an instance of EmailTemplatesGetResponse. + * + * @param request the request which resulted in this EmailTemplatesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public EmailTemplatesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + EmailTemplateContractInner value, + EmailTemplatesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public EmailTemplateContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateHeaders.java new file mode 100644 index 0000000000000..d905f0e47be3b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateHeaders.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.apimanagement.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 EmailTemplatesUpdateHeaders model. */ +@Fluent +public final class EmailTemplatesUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EmailTemplatesUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the EmailTemplatesUpdateHeaders object itself. + */ + public EmailTemplatesUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateResponse.java new file mode 100644 index 0000000000000..1a06886cfd6fc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/EmailTemplatesUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.EmailTemplateContractInner; + +/** Contains all response data for the update operation. */ +public final class EmailTemplatesUpdateResponse + extends ResponseBase { + /** + * Creates an instance of EmailTemplatesUpdateResponse. + * + * @param request the request which resulted in this EmailTemplatesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public EmailTemplatesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + EmailTemplateContractInner value, + EmailTemplatesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public EmailTemplateContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorFieldContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorFieldContract.java new file mode 100644 index 0000000000000..56c4ba04b17e6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorFieldContract.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.apimanagement.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; + +/** Error Field contract. */ +@Fluent +public final class ErrorFieldContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorFieldContract.class); + + /* + * Property level error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Human-readable representation of property-level error. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Property name. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get the code property: Property level error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Property level error code. + * + * @param code the code value to set. + * @return the ErrorFieldContract object itself. + */ + public ErrorFieldContract withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Human-readable representation of property-level error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Human-readable representation of property-level error. + * + * @param message the message value to set. + * @return the ErrorFieldContract object itself. + */ + public ErrorFieldContract withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target property: Property name. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: Property name. + * + * @param target the target value to set. + * @return the ErrorFieldContract object itself. + */ + public ErrorFieldContract withTarget(String target) { + this.target = target; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorResponseBody.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorResponseBody.java new file mode 100644 index 0000000000000..4f46f1bc991ed --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ErrorResponseBody.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Error Body contract. */ +@Fluent +public final class ErrorResponseBody { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorResponseBody.class); + + /* + * Service-defined error code. This code serves as a sub-status for the + * HTTP error code specified in the response. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Human-readable representation of the error. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The list of invalid fields send in request, in case of validation error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the code property: Service-defined error code. This code serves as a sub-status for the HTTP error code + * specified in the response. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Service-defined error code. This code serves as a sub-status for the HTTP error code + * specified in the response. + * + * @param code the code value to set. + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Human-readable representation of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Human-readable representation of the error. + * + * @param message the message value to set. + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the details property: The list of invalid fields send in request, in case of validation error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: The list of invalid fields send in request, in case of validation error. + * + * @param details the details value to set. + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withDetails(List details) { + this.details = details; + 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportApi.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportApi.java new file mode 100644 index 0000000000000..943d079dadee7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportApi.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExportApi. */ +public final class ExportApi extends ExpandableStringEnum { + /** Static value true for ExportApi. */ + public static final ExportApi TRUE = fromString("true"); + + /** + * Creates or finds a ExportApi from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportApi. + */ + @JsonCreator + public static ExportApi fromString(String name) { + return fromString(name, ExportApi.class); + } + + /** @return known ExportApi values. */ + public static Collection values() { + return values(ExportApi.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportFormat.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportFormat.java new file mode 100644 index 0000000000000..81ca5137da102 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportFormat.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExportFormat. */ +public final class ExportFormat extends ExpandableStringEnum { + /** Static value swagger-link for ExportFormat. */ + public static final ExportFormat SWAGGER_LINK = fromString("swagger-link"); + + /** Static value wsdl-link for ExportFormat. */ + public static final ExportFormat WSDL_LINK = fromString("wsdl-link"); + + /** Static value wadl-link for ExportFormat. */ + public static final ExportFormat WADL_LINK = fromString("wadl-link"); + + /** Static value openapi-link for ExportFormat. */ + public static final ExportFormat OPENAPI_LINK = fromString("openapi-link"); + + /** Static value openapi+json-link for ExportFormat. */ + public static final ExportFormat OPENAPI_JSON_LINK = fromString("openapi+json-link"); + + /** + * Creates or finds a ExportFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportFormat. + */ + @JsonCreator + public static ExportFormat fromString(String name) { + return fromString(name, ExportFormat.class); + } + + /** @return known ExportFormat values. */ + public static Collection values() { + return values(ExportFormat.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportResultFormat.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportResultFormat.java new file mode 100644 index 0000000000000..a3a514270a0f8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ExportResultFormat.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExportResultFormat. */ +public final class ExportResultFormat extends ExpandableStringEnum { + /** Static value swagger-link-json for ExportResultFormat. */ + public static final ExportResultFormat SWAGGER_LINK_JSON = fromString("swagger-link-json"); + + /** Static value wsdl-link+xml for ExportResultFormat. */ + public static final ExportResultFormat WSDL_LINK_XML = fromString("wsdl-link+xml"); + + /** Static value wadl-link-json for ExportResultFormat. */ + public static final ExportResultFormat WADL_LINK_JSON = fromString("wadl-link-json"); + + /** Static value openapi-link for ExportResultFormat. */ + public static final ExportResultFormat OPENAPI_LINK = fromString("openapi-link"); + + /** + * Creates or finds a ExportResultFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportResultFormat. + */ + @JsonCreator + public static ExportResultFormat fromString(String name) { + return fromString(name, ExportResultFormat.class); + } + + /** @return known ExportResultFormat values. */ + public static Collection values() { + return values(ExportResultFormat.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApis.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApis.java new file mode 100644 index 0000000000000..c6fd5ba67884b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApis.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayApis. */ +public interface GatewayApis { + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Lists a collection of the APIs associated with a gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String apiId); + + /** + * Checks that API entity specified by identifier is associated with the Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context); + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + ApiContract createOrUpdate(String resourceGroupName, String serviceName, String gatewayId, String apiId); + + /** + * Adds an API to the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param parameters Association entity details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String apiId, + AssociationContract parameters, + Context context); + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String apiId); + + /** + * Deletes the specified API from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String apiId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagHeaders.java new file mode 100644 index 0000000000000..f364a2288a1c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagHeaders.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.apimanagement.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 GatewayApisGetEntityTagHeaders model. */ +@Fluent +public final class GatewayApisGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayApisGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayApisGetEntityTagHeaders object itself. + */ + public GatewayApisGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagResponse.java new file mode 100644 index 0000000000000..12b4783fb987d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayApisGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class GatewayApisGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of GatewayApisGetEntityTagResponse. + * + * @param request the request which resulted in this GatewayApisGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayApisGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + GatewayApisGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorities.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorities.java new file mode 100644 index 0000000000000..8cf31806a9665 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorities.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayCertificateAuthorities. */ +public interface GatewayCertificateAuthorities { + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId); + + /** + * Lists the collection of Certificate Authorities for the specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway certificate authority list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String certificateId); + + /** + * Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context); + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + GatewayCertificateAuthorityContract get( + String resourceGroupName, String serviceName, String gatewayId, String certificateId); + + /** + * Get assigned Gateway Certificate Authority details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return assigned Gateway Certificate Authority details. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String certificateId, Context context); + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String certificateId, String ifMatch); + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param certificateId Identifier of the certificate entity. Must be unique in the current API Management service + * instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + String certificateId, + String ifMatch, + Context context); + + /** + * Get assigned Gateway Certificate Authority details. + * + * @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 assigned Gateway Certificate Authority details. + */ + GatewayCertificateAuthorityContract getById(String id); + + /** + * Get assigned Gateway Certificate Authority details. + * + * @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 assigned Gateway Certificate Authority details. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @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); + + /** + * Remove relationship between Certificate Authority and Gateway entity. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new GatewayCertificateAuthorityContract resource. + * + * @param name resource name. + * @return the first stage of the new GatewayCertificateAuthorityContract definition. + */ + GatewayCertificateAuthorityContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..870516bd224f6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateHeaders.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayCertificateAuthoritiesCreateOrUpdateHeaders model. */ +@Fluent +public final class GatewayCertificateAuthoritiesCreateOrUpdateHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthoritiesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayCertificateAuthoritiesCreateOrUpdateHeaders object itself. + */ + public GatewayCertificateAuthoritiesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..f7662d1a93e55 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class GatewayCertificateAuthoritiesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of GatewayCertificateAuthoritiesCreateOrUpdateResponse. + * + * @param request the request which resulted in this GatewayCertificateAuthoritiesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayCertificateAuthoritiesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayCertificateAuthorityContractInner value, + GatewayCertificateAuthoritiesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayCertificateAuthorityContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..dc8526c0537ee --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagHeaders.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayCertificateAuthoritiesGetEntityTagHeaders model. */ +@Fluent +public final class GatewayCertificateAuthoritiesGetEntityTagHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthoritiesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayCertificateAuthoritiesGetEntityTagHeaders object itself. + */ + public GatewayCertificateAuthoritiesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagResponse.java new file mode 100644 index 0000000000000..f413a1f17db5f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class GatewayCertificateAuthoritiesGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of GatewayCertificateAuthoritiesGetEntityTagResponse. + * + * @param request the request which resulted in this GatewayCertificateAuthoritiesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayCertificateAuthoritiesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + GatewayCertificateAuthoritiesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetHeaders.java new file mode 100644 index 0000000000000..c2338062e531c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetHeaders.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.apimanagement.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 GatewayCertificateAuthoritiesGetHeaders model. */ +@Fluent +public final class GatewayCertificateAuthoritiesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthoritiesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayCertificateAuthoritiesGetHeaders object itself. + */ + public GatewayCertificateAuthoritiesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetResponse.java new file mode 100644 index 0000000000000..e72cd1e3f3874 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthoritiesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; + +/** Contains all response data for the get operation. */ +public final class GatewayCertificateAuthoritiesGetResponse + extends ResponseBase { + /** + * Creates an instance of GatewayCertificateAuthoritiesGetResponse. + * + * @param request the request which resulted in this GatewayCertificateAuthoritiesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayCertificateAuthoritiesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayCertificateAuthorityContractInner value, + GatewayCertificateAuthoritiesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayCertificateAuthorityContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityCollection.java new file mode 100644 index 0000000000000..177ad11f13fcf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Gateway certificate authority list representation. */ +@Immutable +public final class GatewayCertificateAuthorityCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCertificateAuthorityCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityContract.java new file mode 100644 index 0000000000000..1eaa25052fc91 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCertificateAuthorityContract.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner; + +/** An immutable client-side representation of GatewayCertificateAuthorityContract. */ +public interface GatewayCertificateAuthorityContract { + /** + * 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 isTrusted property: Determines whether certificate authority is trusted. + * + * @return the isTrusted value. + */ + Boolean isTrusted(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GatewayCertificateAuthorityContractInner + * object. + * + * @return the inner object. + */ + GatewayCertificateAuthorityContractInner innerModel(); + + /** The entirety of the GatewayCertificateAuthorityContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The GatewayCertificateAuthorityContract definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayCertificateAuthorityContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GatewayCertificateAuthorityContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, gatewayId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service + * instance. Must not have value 'managed'. + * @return the next definition stage. + */ + WithCreate withExistingGateway(String resourceGroupName, String serviceName, String gatewayId); + } + /** + * The stage of the GatewayCertificateAuthorityContract 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.WithIsTrusted, DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayCertificateAuthorityContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayCertificateAuthorityContract create(Context context); + } + /** The stage of the GatewayCertificateAuthorityContract definition allowing to specify isTrusted. */ + interface WithIsTrusted { + /** + * Specifies the isTrusted property: Determines whether certificate authority is trusted.. + * + * @param isTrusted Determines whether certificate authority is trusted. + * @return the next definition stage. + */ + WithCreate withIsTrusted(Boolean isTrusted); + } + /** The stage of the GatewayCertificateAuthorityContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the GatewayCertificateAuthorityContract resource. + * + * @return the stage of resource update. + */ + GatewayCertificateAuthorityContract.Update update(); + + /** The template for GatewayCertificateAuthorityContract update. */ + interface Update extends UpdateStages.WithIsTrusted, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GatewayCertificateAuthorityContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GatewayCertificateAuthorityContract apply(Context context); + } + /** The GatewayCertificateAuthorityContract update stages. */ + interface UpdateStages { + /** The stage of the GatewayCertificateAuthorityContract update allowing to specify isTrusted. */ + interface WithIsTrusted { + /** + * Specifies the isTrusted property: Determines whether certificate authority is trusted.. + * + * @param isTrusted Determines whether certificate authority is trusted. + * @return the next definition stage. + */ + Update withIsTrusted(Boolean isTrusted); + } + /** The stage of the GatewayCertificateAuthorityContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayCertificateAuthorityContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayCertificateAuthorityContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCollection.java new file mode 100644 index 0000000000000..fa49bbb8f706c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Gateway list representation. */ +@Fluent +public final class GatewayCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the GatewayCollection object itself. + */ + public GatewayCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayContract.java new file mode 100644 index 0000000000000..509975a1a7279 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayContract.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; + +/** An immutable client-side representation of GatewayContract. */ +public interface GatewayContract { + /** + * 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 locationData property: Gateway location. + * + * @return the locationData value. + */ + ResourceLocationDataContract locationData(); + + /** + * Gets the description property: Gateway description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner object. + * + * @return the inner object. + */ + GatewayContractInner innerModel(); + + /** The entirety of the GatewayContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The GatewayContract definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GatewayContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the GatewayContract 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.WithLocationData, DefinitionStages.WithDescription, DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayContract create(Context context); + } + /** The stage of the GatewayContract definition allowing to specify locationData. */ + interface WithLocationData { + /** + * Specifies the locationData property: Gateway location.. + * + * @param locationData Gateway location. + * @return the next definition stage. + */ + WithCreate withLocationData(ResourceLocationDataContract locationData); + } + /** The stage of the GatewayContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Gateway description. + * + * @param description Gateway description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the GatewayContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the GatewayContract resource. + * + * @return the stage of resource update. + */ + GatewayContract.Update update(); + + /** The template for GatewayContract update. */ + interface Update extends UpdateStages.WithLocationData, UpdateStages.WithDescription, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GatewayContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GatewayContract apply(Context context); + } + /** The GatewayContract update stages. */ + interface UpdateStages { + /** The stage of the GatewayContract update allowing to specify locationData. */ + interface WithLocationData { + /** + * Specifies the locationData property: Gateway location.. + * + * @param locationData Gateway location. + * @return the next definition stage. + */ + Update withLocationData(ResourceLocationDataContract locationData); + } + /** The stage of the GatewayContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Gateway description. + * + * @param description Gateway description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the GatewayContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayContract refresh(Context context); + + /** + * Retrieves gateway keys. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + GatewayKeysContract listKeys(); + + /** + * Retrieves gateway keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + Response listKeysWithResponse(Context context); + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param parameters Gateway key regeneration request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void regenerateKey(GatewayKeyRegenerationRequestContract parameters); + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param parameters Gateway key regeneration request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response regenerateKeyWithResponse(GatewayKeyRegenerationRequestContract parameters, Context context); + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param parameters Gateway token request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + GatewayTokenContract generateToken(GatewayTokenRequestContract parameters); + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param parameters Gateway token request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + Response generateTokenWithResponse(GatewayTokenRequestContract parameters, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationCollection.java new file mode 100644 index 0000000000000..64159195c5be6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Gateway hostname configuration list representation. */ +@Immutable +public final class GatewayHostnameConfigurationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationContract.java new file mode 100644 index 0000000000000..a1efb372ffb3f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationContract.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; + +/** An immutable client-side representation of GatewayHostnameConfigurationContract. */ +public interface GatewayHostnameConfigurationContract { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the hostname property: Hostname value. Supports valid domain name, partial or full wildcard. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the certificateId property: Identifier of Certificate entity that will be used for TLS connection + * establishment. + * + * @return the certificateId value. + */ + String certificateId(); + + /** + * Gets the negotiateClientCertificate property: Determines whether gateway requests client certificate. + * + * @return the negotiateClientCertificate value. + */ + Boolean negotiateClientCertificate(); + + /** + * Gets the tls10Enabled property: Specifies if TLS 1.0 is supported. + * + * @return the tls10Enabled value. + */ + Boolean tls10Enabled(); + + /** + * Gets the tls11Enabled property: Specifies if TLS 1.1 is supported. + * + * @return the tls11Enabled value. + */ + Boolean tls11Enabled(); + + /** + * Gets the http2Enabled property: Specifies if HTTP/2.0 is supported. + * + * @return the http2Enabled value. + */ + Boolean http2Enabled(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner + * object. + * + * @return the inner object. + */ + GatewayHostnameConfigurationContractInner innerModel(); + + /** The entirety of the GatewayHostnameConfigurationContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The GatewayHostnameConfigurationContract definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayHostnameConfigurationContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, gatewayId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service + * instance. Must not have value 'managed'. + * @return the next definition stage. + */ + WithCreate withExistingGateway(String resourceGroupName, String serviceName, String gatewayId); + } + /** + * The stage of the GatewayHostnameConfigurationContract definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithHostname, + DefinitionStages.WithCertificateId, + DefinitionStages.WithNegotiateClientCertificate, + DefinitionStages.WithTls10Enabled, + DefinitionStages.WithTls11Enabled, + DefinitionStages.WithHttp2Enabled, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayHostnameConfigurationContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayHostnameConfigurationContract create(Context context); + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: Hostname value. Supports valid domain name, partial or full wildcard. + * + * @param hostname Hostname value. Supports valid domain name, partial or full wildcard. + * @return the next definition stage. + */ + WithCreate withHostname(String hostname); + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify certificateId. */ + interface WithCertificateId { + /** + * Specifies the certificateId property: Identifier of Certificate entity that will be used for TLS + * connection establishment. + * + * @param certificateId Identifier of Certificate entity that will be used for TLS connection establishment. + * @return the next definition stage. + */ + WithCreate withCertificateId(String certificateId); + } + /** + * The stage of the GatewayHostnameConfigurationContract definition allowing to specify + * negotiateClientCertificate. + */ + interface WithNegotiateClientCertificate { + /** + * Specifies the negotiateClientCertificate property: Determines whether gateway requests client + * certificate. + * + * @param negotiateClientCertificate Determines whether gateway requests client certificate. + * @return the next definition stage. + */ + WithCreate withNegotiateClientCertificate(Boolean negotiateClientCertificate); + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify tls10Enabled. */ + interface WithTls10Enabled { + /** + * Specifies the tls10Enabled property: Specifies if TLS 1.0 is supported. + * + * @param tls10Enabled Specifies if TLS 1.0 is supported. + * @return the next definition stage. + */ + WithCreate withTls10Enabled(Boolean tls10Enabled); + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify tls11Enabled. */ + interface WithTls11Enabled { + /** + * Specifies the tls11Enabled property: Specifies if TLS 1.1 is supported. + * + * @param tls11Enabled Specifies if TLS 1.1 is supported. + * @return the next definition stage. + */ + WithCreate withTls11Enabled(Boolean tls11Enabled); + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify http2Enabled. */ + interface WithHttp2Enabled { + /** + * Specifies the http2Enabled property: Specifies if HTTP/2.0 is supported. + * + * @param http2Enabled Specifies if HTTP/2.0 is supported. + * @return the next definition stage. + */ + WithCreate withHttp2Enabled(Boolean http2Enabled); + } + /** The stage of the GatewayHostnameConfigurationContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the GatewayHostnameConfigurationContract resource. + * + * @return the stage of resource update. + */ + GatewayHostnameConfigurationContract.Update update(); + + /** The template for GatewayHostnameConfigurationContract update. */ + interface Update + extends UpdateStages.WithHostname, + UpdateStages.WithCertificateId, + UpdateStages.WithNegotiateClientCertificate, + UpdateStages.WithTls10Enabled, + UpdateStages.WithTls11Enabled, + UpdateStages.WithHttp2Enabled, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GatewayHostnameConfigurationContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GatewayHostnameConfigurationContract apply(Context context); + } + /** The GatewayHostnameConfigurationContract update stages. */ + interface UpdateStages { + /** The stage of the GatewayHostnameConfigurationContract update allowing to specify hostname. */ + interface WithHostname { + /** + * Specifies the hostname property: Hostname value. Supports valid domain name, partial or full wildcard. + * + * @param hostname Hostname value. Supports valid domain name, partial or full wildcard. + * @return the next definition stage. + */ + Update withHostname(String hostname); + } + /** The stage of the GatewayHostnameConfigurationContract update allowing to specify certificateId. */ + interface WithCertificateId { + /** + * Specifies the certificateId property: Identifier of Certificate entity that will be used for TLS + * connection establishment. + * + * @param certificateId Identifier of Certificate entity that will be used for TLS connection establishment. + * @return the next definition stage. + */ + Update withCertificateId(String certificateId); + } + /** + * The stage of the GatewayHostnameConfigurationContract update allowing to specify negotiateClientCertificate. + */ + interface WithNegotiateClientCertificate { + /** + * Specifies the negotiateClientCertificate property: Determines whether gateway requests client + * certificate. + * + * @param negotiateClientCertificate Determines whether gateway requests client certificate. + * @return the next definition stage. + */ + Update withNegotiateClientCertificate(Boolean negotiateClientCertificate); + } + /** The stage of the GatewayHostnameConfigurationContract update allowing to specify tls10Enabled. */ + interface WithTls10Enabled { + /** + * Specifies the tls10Enabled property: Specifies if TLS 1.0 is supported. + * + * @param tls10Enabled Specifies if TLS 1.0 is supported. + * @return the next definition stage. + */ + Update withTls10Enabled(Boolean tls10Enabled); + } + /** The stage of the GatewayHostnameConfigurationContract update allowing to specify tls11Enabled. */ + interface WithTls11Enabled { + /** + * Specifies the tls11Enabled property: Specifies if TLS 1.1 is supported. + * + * @param tls11Enabled Specifies if TLS 1.1 is supported. + * @return the next definition stage. + */ + Update withTls11Enabled(Boolean tls11Enabled); + } + /** The stage of the GatewayHostnameConfigurationContract update allowing to specify http2Enabled. */ + interface WithHttp2Enabled { + /** + * Specifies the http2Enabled property: Specifies if HTTP/2.0 is supported. + * + * @param http2Enabled Specifies if HTTP/2.0 is supported. + * @return the next definition stage. + */ + Update withHttp2Enabled(Boolean http2Enabled); + } + /** The stage of the GatewayHostnameConfigurationContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayHostnameConfigurationContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayHostnameConfigurationContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurations.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurations.java new file mode 100644 index 0000000000000..56c3bdfe849c3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurations.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayHostnameConfigurations. */ +public interface GatewayHostnameConfigurations { + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String gatewayId); + + /** + * Lists the collection of hostname configurations for the specified gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| hostname | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway hostname configuration list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String gatewayId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId, String hcId); + + /** + * Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context); + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + GatewayHostnameConfigurationContract get( + String resourceGroupName, String serviceName, String gatewayId, String hcId); + + /** + * Get details of a hostname configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a hostname configuration. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, Context context); + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String hcId, String ifMatch); + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param hcId Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String hcId, String ifMatch, Context context); + + /** + * Get details of a hostname configuration. + * + * @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 details of a hostname configuration. + */ + GatewayHostnameConfigurationContract getById(String id); + + /** + * Get details of a hostname configuration. + * + * @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 details of a hostname configuration. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified hostname configuration from the specified Gateway. + * + * @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 the specified hostname configuration from the specified Gateway. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new GatewayHostnameConfigurationContract resource. + * + * @param name resource name. + * @return the first stage of the new GatewayHostnameConfigurationContract definition. + */ + GatewayHostnameConfigurationContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..8bd60c2b1b9a0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateHeaders.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayHostnameConfigurationsCreateOrUpdateHeaders model. */ +@Fluent +public final class GatewayHostnameConfigurationsCreateOrUpdateHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayHostnameConfigurationsCreateOrUpdateHeaders object itself. + */ + public GatewayHostnameConfigurationsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..e890293f0e243 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsCreateOrUpdateResponse.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class GatewayHostnameConfigurationsCreateOrUpdateResponse + extends ResponseBase< + GatewayHostnameConfigurationsCreateOrUpdateHeaders, GatewayHostnameConfigurationContractInner> { + /** + * Creates an instance of GatewayHostnameConfigurationsCreateOrUpdateResponse. + * + * @param request the request which resulted in this GatewayHostnameConfigurationsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayHostnameConfigurationsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayHostnameConfigurationContractInner value, + GatewayHostnameConfigurationsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayHostnameConfigurationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..d747813308eaa --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagHeaders.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GatewayHostnameConfigurationsGetEntityTagHeaders model. */ +@Fluent +public final class GatewayHostnameConfigurationsGetEntityTagHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayHostnameConfigurationsGetEntityTagHeaders object itself. + */ + public GatewayHostnameConfigurationsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagResponse.java new file mode 100644 index 0000000000000..c46c71f04891c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class GatewayHostnameConfigurationsGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of GatewayHostnameConfigurationsGetEntityTagResponse. + * + * @param request the request which resulted in this GatewayHostnameConfigurationsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayHostnameConfigurationsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + GatewayHostnameConfigurationsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetHeaders.java new file mode 100644 index 0000000000000..303e88c0075e1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetHeaders.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.apimanagement.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 GatewayHostnameConfigurationsGetHeaders model. */ +@Fluent +public final class GatewayHostnameConfigurationsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayHostnameConfigurationsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewayHostnameConfigurationsGetHeaders object itself. + */ + public GatewayHostnameConfigurationsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetResponse.java new file mode 100644 index 0000000000000..b69e081c01f77 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayHostnameConfigurationsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayHostnameConfigurationContractInner; + +/** Contains all response data for the get operation. */ +public final class GatewayHostnameConfigurationsGetResponse + extends ResponseBase { + /** + * Creates an instance of GatewayHostnameConfigurationsGetResponse. + * + * @param request the request which resulted in this GatewayHostnameConfigurationsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewayHostnameConfigurationsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayHostnameConfigurationContractInner value, + GatewayHostnameConfigurationsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayHostnameConfigurationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeyRegenerationRequestContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeyRegenerationRequestContract.java new file mode 100644 index 0000000000000..90c63f9a8f461 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeyRegenerationRequestContract.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.apimanagement.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; + +/** Gateway key regeneration request contract properties. */ +@Fluent +public final class GatewayKeyRegenerationRequestContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayKeyRegenerationRequestContract.class); + + /* + * The Key being regenerated. + */ + @JsonProperty(value = "keyType", required = true) + private KeyType keyType; + + /** + * Get the keyType property: The Key being regenerated. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The Key being regenerated. + * + * @param keyType the keyType value to set. + * @return the GatewayKeyRegenerationRequestContract object itself. + */ + public GatewayKeyRegenerationRequestContract withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model GatewayKeyRegenerationRequestContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeysContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeysContract.java new file mode 100644 index 0000000000000..8d7e13afdcbc9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayKeysContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner; + +/** An immutable client-side representation of GatewayKeysContract. */ +public interface GatewayKeysContract { + /** + * Gets the primary property: Primary gateway key. + * + * @return the primary value. + */ + String primary(); + + /** + * Gets the secondary property: Secondary gateway key. + * + * @return the secondary value. + */ + String secondary(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner object. + * + * @return the inner object. + */ + GatewayKeysContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenContract.java new file mode 100644 index 0000000000000..e8758b80d3e20 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenContract.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayTokenContractInner; + +/** An immutable client-side representation of GatewayTokenContract. */ +public interface GatewayTokenContract { + /** + * Gets the value property: Shared Access Authentication token value for the Gateway. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GatewayTokenContractInner object. + * + * @return the inner object. + */ + GatewayTokenContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenRequestContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenRequestContract.java new file mode 100644 index 0000000000000..82f4daebae3c5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewayTokenRequestContract.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Gateway token request contract properties. */ +@Fluent +public final class GatewayTokenRequestContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayTokenRequestContract.class); + + /* + * The Key to be used to generate gateway token. + */ + @JsonProperty(value = "keyType", required = true) + private KeyType keyType; + + /* + * The Expiry time of the Token. Maximum token expiry time is set to 30 + * days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + * as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "expiry", required = true) + private OffsetDateTime expiry; + + /** + * Get the keyType property: The Key to be used to generate gateway token. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The Key to be used to generate gateway token. + * + * @param keyType the keyType value to set. + * @return the GatewayTokenRequestContract object itself. + */ + public GatewayTokenRequestContract withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get the expiry property: The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param expiry the expiry value to set. + * @return the GatewayTokenRequestContract object itself. + */ + public GatewayTokenRequestContract withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model GatewayTokenRequestContract")); + } + if (expiry() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property expiry in model GatewayTokenRequestContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Gateways.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Gateways.java new file mode 100644 index 0000000000000..ef1cfedb977e0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Gateways.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Gateways. */ +public interface Gateways { + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of gateways registered with service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| region | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Gateway list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Gets the entity state (Etag) version of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the Gateway specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context); + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + GatewayContract get(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context); + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayId, String ifMatch); + + /** + * Deletes specific Gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String gatewayId, String ifMatch, Context context); + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + GatewayKeysContract listKeys(String resourceGroupName, String serviceName, String gatewayId); + + /** + * Retrieves gateway keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return gateway authentication keys. + */ + Response listKeysWithResponse( + String resourceGroupName, String serviceName, String gatewayId, Context context); + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void regenerateKey( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters); + + /** + * Regenerates specified gateway key invalidating any tokens created with it. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway key regeneration request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response regenerateKeyWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayKeyRegenerationRequestContract parameters, + Context context); + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + GatewayTokenContract generateToken( + String resourceGroupName, String serviceName, String gatewayId, GatewayTokenRequestContract parameters); + + /** + * Gets the Shared Access Authorization Token for the gateway. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param gatewayId Gateway entity identifier. Must be unique in the current API Management service instance. Must + * not have value 'managed'. + * @param parameters Gateway token request contract properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the gateway. + */ + Response generateTokenWithResponse( + String resourceGroupName, + String serviceName, + String gatewayId, + GatewayTokenRequestContract parameters, + Context context); + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + GatewayContract getById(String id); + + /** + * Gets the details of the Gateway specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Gateway specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific Gateway. + * + * @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 specific Gateway. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new GatewayContract resource. + * + * @param name resource name. + * @return the first stage of the new GatewayContract definition. + */ + GatewayContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..cac0eb63f41fe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateHeaders.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.apimanagement.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 GatewaysCreateOrUpdateHeaders model. */ +@Fluent +public final class GatewaysCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaysCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewaysCreateOrUpdateHeaders object itself. + */ + public GatewaysCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..07656a9bd2ccf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class GatewaysCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of GatewaysCreateOrUpdateResponse. + * + * @param request the request which resulted in this GatewaysCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewaysCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayContractInner value, + GatewaysCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagHeaders.java new file mode 100644 index 0000000000000..80b8afe47d5ca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagHeaders.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.apimanagement.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 GatewaysGetEntityTagHeaders model. */ +@Fluent +public final class GatewaysGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaysGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewaysGetEntityTagHeaders object itself. + */ + public GatewaysGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagResponse.java new file mode 100644 index 0000000000000..27da32816f868 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class GatewaysGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of GatewaysGetEntityTagResponse. + * + * @param request the request which resulted in this GatewaysGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewaysGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, GatewaysGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetHeaders.java new file mode 100644 index 0000000000000..0589cadddff07 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetHeaders.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.apimanagement.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 GatewaysGetHeaders model. */ +@Fluent +public final class GatewaysGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaysGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewaysGetHeaders object itself. + */ + public GatewaysGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetResponse.java new file mode 100644 index 0000000000000..009c98f1669e6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; + +/** Contains all response data for the get operation. */ +public final class GatewaysGetResponse extends ResponseBase { + /** + * Creates an instance of GatewaysGetResponse. + * + * @param request the request which resulted in this GatewaysGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewaysGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayContractInner value, + GatewaysGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysHeaders.java new file mode 100644 index 0000000000000..75d21ad870ac8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysHeaders.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.apimanagement.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 GatewaysListKeysHeaders model. */ +@Fluent +public final class GatewaysListKeysHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaysListKeysHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewaysListKeysHeaders object itself. + */ + public GatewaysListKeysHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysResponse.java new file mode 100644 index 0000000000000..c371d8bcfd7e5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysListKeysResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayKeysContractInner; + +/** Contains all response data for the listKeys operation. */ +public final class GatewaysListKeysResponse extends ResponseBase { + /** + * Creates an instance of GatewaysListKeysResponse. + * + * @param request the request which resulted in this GatewaysListKeysResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewaysListKeysResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayKeysContractInner value, + GatewaysListKeysHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayKeysContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateHeaders.java new file mode 100644 index 0000000000000..9ec6b6278517f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateHeaders.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.apimanagement.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 GatewaysUpdateHeaders model. */ +@Fluent +public final class GatewaysUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaysUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GatewaysUpdateHeaders object itself. + */ + public GatewaysUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateResponse.java new file mode 100644 index 0000000000000..ced6da698b49f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GatewaysUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GatewayContractInner; + +/** Contains all response data for the update operation. */ +public final class GatewaysUpdateResponse extends ResponseBase { + /** + * Creates an instance of GatewaysUpdateResponse. + * + * @param request the request which resulted in this GatewaysUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GatewaysUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GatewayContractInner value, + GatewaysUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GatewayContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GenerateSsoUrlResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GenerateSsoUrlResult.java new file mode 100644 index 0000000000000..d004a6c828a04 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GenerateSsoUrlResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.GenerateSsoUrlResultInner; + +/** An immutable client-side representation of GenerateSsoUrlResult. */ +public interface GenerateSsoUrlResult { + /** + * Gets the value property: Redirect Url containing the SSO URL value. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GenerateSsoUrlResultInner object. + * + * @return the inner object. + */ + GenerateSsoUrlResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GrantType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GrantType.java new file mode 100644 index 0000000000000..09659b9260341 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GrantType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GrantType. */ +public final class GrantType extends ExpandableStringEnum { + /** Static value authorizationCode for GrantType. */ + public static final GrantType AUTHORIZATION_CODE = fromString("authorizationCode"); + + /** Static value implicit for GrantType. */ + public static final GrantType IMPLICIT = fromString("implicit"); + + /** Static value resourceOwnerPassword for GrantType. */ + public static final GrantType RESOURCE_OWNER_PASSWORD = fromString("resourceOwnerPassword"); + + /** Static value clientCredentials for GrantType. */ + public static final GrantType CLIENT_CREDENTIALS = fromString("clientCredentials"); + + /** + * Creates or finds a GrantType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GrantType. + */ + @JsonCreator + public static GrantType fromString(String name) { + return fromString(name, GrantType.class); + } + + /** @return known GrantType values. */ + public static Collection values() { + return values(GrantType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCollection.java new file mode 100644 index 0000000000000..ab61a00cf676c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Group list representation. */ +@Fluent +public final class GroupCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the GroupCollection object itself. + */ + public GroupCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the GroupCollection object itself. + */ + public GroupCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the GroupCollection object itself. + */ + public GroupCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContract.java new file mode 100644 index 0000000000000..07e20ce284fec --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContract.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; + +/** An immutable client-side representation of GroupContract. */ +public interface GroupContract { + /** + * 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 displayName property: Group name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: Group description. Can contain HTML formatting tags. + * + * @return the description value. + */ + String description(); + + /** + * Gets the builtIn property: true if the group is one of the three system groups (Administrators, Developers, or + * Guests); otherwise false. + * + * @return the builtIn value. + */ + Boolean builtIn(); + + /** + * Gets the typePropertiesType property: Group type. + * + * @return the typePropertiesType value. + */ + GroupType typePropertiesType(); + + /** + * Gets the externalId property: For external groups, this property contains the id of the group from the external + * identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object + * id>`; otherwise the value is null. + * + * @return the externalId value. + */ + String externalId(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner object. + * + * @return the inner object. + */ + GroupContractInner innerModel(); + + /** The entirety of the GroupContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The GroupContract definition stages. */ + interface DefinitionStages { + /** The first stage of the GroupContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GroupContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the GroupContract 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.WithDisplayName, + DefinitionStages.WithDescription, + DefinitionStages.WithType, + DefinitionStages.WithExternalId, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + GroupContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GroupContract create(Context context); + } + /** The stage of the GroupContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Group name.. + * + * @param displayName Group name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the GroupContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Group description.. + * + * @param description Group description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the GroupContract definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Group type.. + * + * @param type Group type. + * @return the next definition stage. + */ + WithCreate withType(GroupType type); + } + /** The stage of the GroupContract definition allowing to specify externalId. */ + interface WithExternalId { + /** + * Specifies the externalId property: Identifier of the external groups, this property contains the id of + * the group from the external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null.. + * + * @param externalId Identifier of the external groups, this property contains the id of the group from the + * external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. + * @return the next definition stage. + */ + WithCreate withExternalId(String externalId); + } + /** The stage of the GroupContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the GroupContract resource. + * + * @return the stage of resource update. + */ + GroupContract.Update update(); + + /** The template for GroupContract update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDescription, + UpdateStages.WithType, + UpdateStages.WithExternalId, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GroupContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GroupContract apply(Context context); + } + /** The GroupContract update stages. */ + interface UpdateStages { + /** The stage of the GroupContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Group name.. + * + * @param displayName Group name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the GroupContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Group description.. + * + * @param description Group description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the GroupContract update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Group type.. + * + * @param type Group type. + * @return the next definition stage. + */ + Update withType(GroupType type); + } + /** The stage of the GroupContract update allowing to specify externalId. */ + interface WithExternalId { + /** + * Specifies the externalId property: Identifier of the external groups, this property contains the id of + * the group from the external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null.. + * + * @param externalId Identifier of the external groups, this property contains the id of the group from the + * external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. + * @return the next definition stage. + */ + Update withExternalId(String externalId); + } + /** The stage of the GroupContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GroupContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GroupContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContractProperties.java new file mode 100644 index 0000000000000..ed8b32932d17d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupContractProperties.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.apimanagement.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; + +/** Group contract Properties. */ +@Fluent +public final class GroupContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupContractProperties.class); + + /* + * Group name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Group description. Can contain HTML formatting tags. + */ + @JsonProperty(value = "description") + private String description; + + /* + * true if the group is one of the three system groups (Administrators, + * Developers, or Guests); otherwise false. + */ + @JsonProperty(value = "builtIn", access = JsonProperty.Access.WRITE_ONLY) + private Boolean builtIn; + + /* + * Group type. + */ + @JsonProperty(value = "type") + private GroupType type; + + /* + * For external groups, this property contains the id of the group from the + * external identity provider, e.g. for Azure Active Directory + * `aad://.onmicrosoft.com/groups/`; otherwise the + * value is null. + */ + @JsonProperty(value = "externalId") + private String externalId; + + /** + * Get the displayName property: Group name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Group name. + * + * @param displayName the displayName value to set. + * @return the GroupContractProperties object itself. + */ + public GroupContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: Group description. Can contain HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Group description. Can contain HTML formatting tags. + * + * @param description the description value to set. + * @return the GroupContractProperties object itself. + */ + public GroupContractProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the builtIn property: true if the group is one of the three system groups (Administrators, Developers, or + * Guests); otherwise false. + * + * @return the builtIn value. + */ + public Boolean builtIn() { + return this.builtIn; + } + + /** + * Get the type property: Group type. + * + * @return the type value. + */ + public GroupType type() { + return this.type; + } + + /** + * Set the type property: Group type. + * + * @param type the type value to set. + * @return the GroupContractProperties object itself. + */ + public GroupContractProperties withType(GroupType type) { + this.type = type; + return this; + } + + /** + * Get the externalId property: For external groups, this property contains the id of the group from the external + * identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object + * id>`; otherwise the value is null. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: For external groups, this property contains the id of the group from the external + * identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object + * id>`; otherwise the value is null. + * + * @param externalId the externalId value to set. + * @return the GroupContractProperties object itself. + */ + public GroupContractProperties withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model GroupContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCreateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCreateParameters.java new file mode 100644 index 0000000000000..6eaa2bcf45d07 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupCreateParameters.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Create Group operation. */ +@JsonFlatten +@Fluent +public class GroupCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupCreateParameters.class); + + /* + * Group name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Group description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Group type. + */ + @JsonProperty(value = "properties.type") + private GroupType type; + + /* + * Identifier of the external groups, this property contains the id of the + * group from the external identity provider, e.g. for Azure Active + * Directory `aad://.onmicrosoft.com/groups/`; + * otherwise the value is null. + */ + @JsonProperty(value = "properties.externalId") + private String externalId; + + /** + * Get the displayName property: Group name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Group name. + * + * @param displayName the displayName value to set. + * @return the GroupCreateParameters object itself. + */ + public GroupCreateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: Group description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Group description. + * + * @param description the description value to set. + * @return the GroupCreateParameters object itself. + */ + public GroupCreateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type property: Group type. + * + * @return the type value. + */ + public GroupType type() { + return this.type; + } + + /** + * Set the type property: Group type. + * + * @param type the type value to set. + * @return the GroupCreateParameters object itself. + */ + public GroupCreateParameters withType(GroupType type) { + this.type = type; + return this; + } + + /** + * Get the externalId property: Identifier of the external groups, this property contains the id of the group from + * the external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: Identifier of the external groups, this property contains the id of the group from + * the external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. + * + * @param externalId the externalId value to set. + * @return the GroupCreateParameters object itself. + */ + public GroupCreateParameters withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupType.java new file mode 100644 index 0000000000000..1ff6dafbb00ff --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupType.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for GroupType. */ +public enum GroupType { + /** Enum value custom. */ + CUSTOM("custom"), + + /** Enum value system. */ + SYSTEM("system"), + + /** Enum value external. */ + EXTERNAL("external"); + + /** The actual serialized value for a GroupType instance. */ + private final String value; + + GroupType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GroupType instance. + * + * @param value the serialized value to parse. + * @return the parsed GroupType object, or null if unable to parse. + */ + @JsonCreator + public static GroupType fromString(String value) { + GroupType[] items = GroupType.values(); + for (GroupType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUpdateParameters.java new file mode 100644 index 0000000000000..f591dd94b24e5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUpdateParameters.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Update Group operation. */ +@JsonFlatten +@Fluent +public class GroupUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupUpdateParameters.class); + + /* + * Group name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Group description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Group type. + */ + @JsonProperty(value = "properties.type") + private GroupType type; + + /* + * Identifier of the external groups, this property contains the id of the + * group from the external identity provider, e.g. for Azure Active + * Directory `aad://.onmicrosoft.com/groups/`; + * otherwise the value is null. + */ + @JsonProperty(value = "properties.externalId") + private String externalId; + + /** + * Get the displayName property: Group name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Group name. + * + * @param displayName the displayName value to set. + * @return the GroupUpdateParameters object itself. + */ + public GroupUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: Group description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Group description. + * + * @param description the description value to set. + * @return the GroupUpdateParameters object itself. + */ + public GroupUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type property: Group type. + * + * @return the type value. + */ + public GroupType type() { + return this.type; + } + + /** + * Set the type property: Group type. + * + * @param type the type value to set. + * @return the GroupUpdateParameters object itself. + */ + public GroupUpdateParameters withType(GroupType type) { + this.type = type; + return this; + } + + /** + * Get the externalId property: Identifier of the external groups, this property contains the id of the group from + * the external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: Identifier of the external groups, this property contains the id of the group from + * the external identity provider, e.g. for Azure Active Directory + * `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. + * + * @param externalId the externalId value to set. + * @return the GroupUpdateParameters object itself. + */ + public GroupUpdateParameters withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUsers.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUsers.java new file mode 100644 index 0000000000000..d51f75eff83ae --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupUsers.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 GroupUsers. */ +public interface GroupUsers { + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + PagedIterable list(String resourceGroupName, String serviceName, String groupId); + + /** + * Lists a collection of user entities associated with the group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| registrationDate | filter | ge, le, eq, ne, gt, lt + * | |</br>| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + PagedIterable list( + String resourceGroupName, + String serviceName, + String groupId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkEntityExists(String resourceGroupName, String serviceName, String groupId, String userId); + + /** + * Checks that user entity specified by identifier is associated with the group entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context); + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + UserContract create(String resourceGroupName, String serviceName, String groupId, String userId); + + /** + * Add existing user to existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user details. + */ + Response createWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context); + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String groupId, String userId); + + /** + * Remove existing user from existing group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String userId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Groups.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Groups.java new file mode 100644 index 0000000000000..b1af13336fff3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Groups.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Groups. */ +public interface Groups { + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of groups defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| externalId | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String groupId); + + /** + * Gets the entity state (Etag) version of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the group specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context); + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + GroupContract get(String resourceGroupName, String serviceName, String groupId); + + /** + * Gets the details of the group specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String groupId, Context context); + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String groupId, String ifMatch); + + /** + * Deletes specific group of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String groupId, String ifMatch, Context context); + + /** + * Gets the details of the group specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + GroupContract getById(String id); + + /** + * Gets the details of the group specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the group specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific group of the API Management service instance. + * + * @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 specific group of the API Management service instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new GroupContract resource. + * + * @param name resource name. + * @return the first stage of the new GroupContract definition. + */ + GroupContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..32ada9fdbd06d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateHeaders.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.apimanagement.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 GroupsCreateOrUpdateHeaders model. */ +@Fluent +public final class GroupsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GroupsCreateOrUpdateHeaders object itself. + */ + public GroupsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..7cc29225fa8e6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class GroupsCreateOrUpdateResponse extends ResponseBase { + /** + * Creates an instance of GroupsCreateOrUpdateResponse. + * + * @param request the request which resulted in this GroupsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GroupsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GroupContractInner value, + GroupsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GroupContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..8c01624964481 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagHeaders.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.apimanagement.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 GroupsGetEntityTagHeaders model. */ +@Fluent +public final class GroupsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GroupsGetEntityTagHeaders object itself. + */ + public GroupsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagResponse.java new file mode 100644 index 0000000000000..08991eda72d81 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class GroupsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of GroupsGetEntityTagResponse. + * + * @param request the request which resulted in this GroupsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GroupsGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, GroupsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetHeaders.java new file mode 100644 index 0000000000000..e8d081db86013 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetHeaders.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.apimanagement.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 GroupsGetHeaders model. */ +@Fluent +public final class GroupsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GroupsGetHeaders object itself. + */ + public GroupsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetResponse.java new file mode 100644 index 0000000000000..c09156312b626 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; + +/** Contains all response data for the get operation. */ +public final class GroupsGetResponse extends ResponseBase { + /** + * Creates an instance of GroupsGetResponse. + * + * @param request the request which resulted in this GroupsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GroupsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GroupContractInner value, + GroupsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GroupContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateHeaders.java new file mode 100644 index 0000000000000..eb1d43867de1c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateHeaders.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.apimanagement.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 GroupsUpdateHeaders model. */ +@Fluent +public final class GroupsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the GroupsUpdateHeaders object itself. + */ + public GroupsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateResponse.java new file mode 100644 index 0000000000000..6aedfe6a2e162 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/GroupsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.GroupContractInner; + +/** Contains all response data for the update operation. */ +public final class GroupsUpdateResponse extends ResponseBase { + /** + * Creates an instance of GroupsUpdateResponse. + * + * @param request the request which resulted in this GroupsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GroupsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + GroupContractInner value, + GroupsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public GroupContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameConfiguration.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameConfiguration.java new file mode 100644 index 0000000000000..d3178487e785e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameConfiguration.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Custom hostname configuration. */ +@Fluent +public final class HostnameConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HostnameConfiguration.class); + + /* + * Hostname type. + */ + @JsonProperty(value = "type", required = true) + private HostnameType type; + + /* + * Hostname to configure on the Api Management service. + */ + @JsonProperty(value = "hostName", required = true) + private String hostname; + + /* + * Url to the KeyVault Secret containing the Ssl Certificate. If absolute + * Url containing version is provided, auto-update of ssl certificate will + * not work. This requires Api Management service to be configured with + * aka.ms/apimmsi. The secret should be of type *application/x-pkcs12* + */ + @JsonProperty(value = "keyVaultId") + private String keyVaultId; + + /* + * System or User Assigned Managed identity clientId as generated by Azure + * AD, which has GET access to the keyVault containing the SSL certificate. + */ + @JsonProperty(value = "identityClientId") + private String identityClientId; + + /* + * Base64 Encoded certificate. + */ + @JsonProperty(value = "encodedCertificate") + private String encodedCertificate; + + /* + * Certificate Password. + */ + @JsonProperty(value = "certificatePassword") + private String certificatePassword; + + /* + * Specify true to setup the certificate associated with this Hostname as + * the Default SSL Certificate. If a client does not send the SNI header, + * then this will be the certificate that will be challenged. The property + * is useful if a service has multiple custom hostname enabled and it needs + * to decide on the default ssl certificate. The setting only applied to + * Proxy Hostname Type. + */ + @JsonProperty(value = "defaultSslBinding") + private Boolean defaultSslBinding; + + /* + * Specify true to always negotiate client certificate on the hostname. + * Default Value is false. + */ + @JsonProperty(value = "negotiateClientCertificate") + private Boolean negotiateClientCertificate; + + /* + * Certificate information. + */ + @JsonProperty(value = "certificate") + private CertificateInformation certificate; + + /** + * Get the type property: Hostname type. + * + * @return the type value. + */ + public HostnameType type() { + return this.type; + } + + /** + * Set the type property: Hostname type. + * + * @param type the type value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withType(HostnameType type) { + this.type = type; + return this; + } + + /** + * Get the hostname property: Hostname to configure on the Api Management service. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Hostname to configure on the Api Management service. + * + * @param hostname the hostname value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the keyVaultId property: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url + * containing version is provided, auto-update of ssl certificate will not work. This requires Api Management + * service to be configured with aka.ms/apimmsi. The secret should be of type *application/x-pkcs12*. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set the keyVaultId property: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url + * containing version is provided, auto-update of ssl certificate will not work. This requires Api Management + * service to be configured with aka.ms/apimmsi. The secret should be of type *application/x-pkcs12*. + * + * @param keyVaultId the keyVaultId value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get the identityClientId property: System or User Assigned Managed identity clientId as generated by Azure AD, + * which has GET access to the keyVault containing the SSL certificate. + * + * @return the identityClientId value. + */ + public String identityClientId() { + return this.identityClientId; + } + + /** + * Set the identityClientId property: System or User Assigned Managed identity clientId as generated by Azure AD, + * which has GET access to the keyVault containing the SSL certificate. + * + * @param identityClientId the identityClientId value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withIdentityClientId(String identityClientId) { + this.identityClientId = identityClientId; + return this; + } + + /** + * Get the encodedCertificate property: Base64 Encoded certificate. + * + * @return the encodedCertificate value. + */ + public String encodedCertificate() { + return this.encodedCertificate; + } + + /** + * Set the encodedCertificate property: Base64 Encoded certificate. + * + * @param encodedCertificate the encodedCertificate value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withEncodedCertificate(String encodedCertificate) { + this.encodedCertificate = encodedCertificate; + return this; + } + + /** + * Get the certificatePassword property: Certificate Password. + * + * @return the certificatePassword value. + */ + public String certificatePassword() { + return this.certificatePassword; + } + + /** + * Set the certificatePassword property: Certificate Password. + * + * @param certificatePassword the certificatePassword value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withCertificatePassword(String certificatePassword) { + this.certificatePassword = certificatePassword; + return this; + } + + /** + * Get the defaultSslBinding property: Specify true to setup the certificate associated with this Hostname as the + * Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be + * challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on + * the default ssl certificate. The setting only applied to Proxy Hostname Type. + * + * @return the defaultSslBinding value. + */ + public Boolean defaultSslBinding() { + return this.defaultSslBinding; + } + + /** + * Set the defaultSslBinding property: Specify true to setup the certificate associated with this Hostname as the + * Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be + * challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on + * the default ssl certificate. The setting only applied to Proxy Hostname Type. + * + * @param defaultSslBinding the defaultSslBinding value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withDefaultSslBinding(Boolean defaultSslBinding) { + this.defaultSslBinding = defaultSslBinding; + return this; + } + + /** + * Get the negotiateClientCertificate property: Specify true to always negotiate client certificate on the hostname. + * Default Value is false. + * + * @return the negotiateClientCertificate value. + */ + public Boolean negotiateClientCertificate() { + return this.negotiateClientCertificate; + } + + /** + * Set the negotiateClientCertificate property: Specify true to always negotiate client certificate on the hostname. + * Default Value is false. + * + * @param negotiateClientCertificate the negotiateClientCertificate value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withNegotiateClientCertificate(Boolean negotiateClientCertificate) { + this.negotiateClientCertificate = negotiateClientCertificate; + return this; + } + + /** + * Get the certificate property: Certificate information. + * + * @return the certificate value. + */ + public CertificateInformation certificate() { + return this.certificate; + } + + /** + * Set the certificate property: Certificate information. + * + * @param certificate the certificate value to set. + * @return the HostnameConfiguration object itself. + */ + public HostnameConfiguration withCertificate(CertificateInformation certificate) { + this.certificate = certificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model HostnameConfiguration")); + } + if (hostname() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property hostname in model HostnameConfiguration")); + } + if (certificate() != null) { + certificate().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameType.java new file mode 100644 index 0000000000000..e214a919d7e7c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HostnameType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HostnameType. */ +public final class HostnameType extends ExpandableStringEnum { + /** Static value Proxy for HostnameType. */ + public static final HostnameType PROXY = fromString("Proxy"); + + /** Static value Portal for HostnameType. */ + public static final HostnameType PORTAL = fromString("Portal"); + + /** Static value Management for HostnameType. */ + public static final HostnameType MANAGEMENT = fromString("Management"); + + /** Static value Scm for HostnameType. */ + public static final HostnameType SCM = fromString("Scm"); + + /** Static value DeveloperPortal for HostnameType. */ + public static final HostnameType DEVELOPER_PORTAL = fromString("DeveloperPortal"); + + /** + * Creates or finds a HostnameType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostnameType. + */ + @JsonCreator + public static HostnameType fromString(String name) { + return fromString(name, HostnameType.class); + } + + /** @return known HostnameType values. */ + public static Collection values() { + return values(HostnameType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpCorrelationProtocol.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpCorrelationProtocol.java new file mode 100644 index 0000000000000..66ca151a7781b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpCorrelationProtocol.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HttpCorrelationProtocol. */ +public final class HttpCorrelationProtocol extends ExpandableStringEnum { + /** Static value None for HttpCorrelationProtocol. */ + public static final HttpCorrelationProtocol NONE = fromString("None"); + + /** Static value Legacy for HttpCorrelationProtocol. */ + public static final HttpCorrelationProtocol LEGACY = fromString("Legacy"); + + /** Static value W3C for HttpCorrelationProtocol. */ + public static final HttpCorrelationProtocol W3C = fromString("W3C"); + + /** + * Creates or finds a HttpCorrelationProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpCorrelationProtocol. + */ + @JsonCreator + public static HttpCorrelationProtocol fromString(String name) { + return fromString(name, HttpCorrelationProtocol.class); + } + + /** @return known HttpCorrelationProtocol values. */ + public static Collection values() { + return values(HttpCorrelationProtocol.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpMessageDiagnostic.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpMessageDiagnostic.java new file mode 100644 index 0000000000000..0d5c32dfc34c1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/HttpMessageDiagnostic.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Http message diagnostic settings. */ +@Fluent +public final class HttpMessageDiagnostic { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpMessageDiagnostic.class); + + /* + * Array of HTTP Headers to log. + */ + @JsonProperty(value = "headers") + private List headers; + + /* + * Body logging settings. + */ + @JsonProperty(value = "body") + private BodyDiagnosticSettings body; + + /* + * Data masking settings. + */ + @JsonProperty(value = "dataMasking") + private DataMasking dataMasking; + + /** + * Get the headers property: Array of HTTP Headers to log. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: Array of HTTP Headers to log. + * + * @param headers the headers value to set. + * @return the HttpMessageDiagnostic object itself. + */ + public HttpMessageDiagnostic withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the body property: Body logging settings. + * + * @return the body value. + */ + public BodyDiagnosticSettings body() { + return this.body; + } + + /** + * Set the body property: Body logging settings. + * + * @param body the body value to set. + * @return the HttpMessageDiagnostic object itself. + */ + public HttpMessageDiagnostic withBody(BodyDiagnosticSettings body) { + this.body = body; + return this; + } + + /** + * Get the dataMasking property: Data masking settings. + * + * @return the dataMasking value. + */ + public DataMasking dataMasking() { + return this.dataMasking; + } + + /** + * Set the dataMasking property: Data masking settings. + * + * @param dataMasking the dataMasking value to set. + * @return the HttpMessageDiagnostic object itself. + */ + public HttpMessageDiagnostic withDataMasking(DataMasking dataMasking) { + this.dataMasking = dataMasking; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (body() != null) { + body().validate(); + } + if (dataMasking() != null) { + dataMasking().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderBaseParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderBaseParameters.java new file mode 100644 index 0000000000000..bc8278f1bf40a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderBaseParameters.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Identity Provider Base Parameter Properties. */ +@Fluent +public class IdentityProviderBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderBaseParameters.class); + + /* + * Identity Provider Type identifier. + */ + @JsonProperty(value = "type") + private IdentityProviderType type; + + /* + * The TenantId to use instead of Common when logging into Active Directory + */ + @JsonProperty(value = "signinTenant") + private String signinTenant; + + /* + * List of Allowed Tenants when configuring Azure Active Directory login. + */ + @JsonProperty(value = "allowedTenants") + private List allowedTenants; + + /* + * OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + */ + @JsonProperty(value = "authority") + private String authority; + + /* + * Signup Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "signupPolicyName") + private String signupPolicyName; + + /* + * Signin Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "signinPolicyName") + private String signinPolicyName; + + /* + * Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "profileEditingPolicyName") + private String profileEditingPolicyName; + + /* + * Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "passwordResetPolicyName") + private String passwordResetPolicyName; + + /** + * Get the type property: Identity Provider Type identifier. + * + * @return the type value. + */ + public IdentityProviderType type() { + return this.type; + } + + /** + * Set the type property: Identity Provider Type identifier. + * + * @param type the type value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withType(IdentityProviderType type) { + this.type = type; + return this; + } + + /** + * Get the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @return the signinTenant value. + */ + public String signinTenant() { + return this.signinTenant; + } + + /** + * Set the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @param signinTenant the signinTenant value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withSigninTenant(String signinTenant) { + this.signinTenant = signinTenant; + return this; + } + + /** + * Get the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @return the allowedTenants value. + */ + public List allowedTenants() { + return this.allowedTenants; + } + + /** + * Set the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @param allowedTenants the allowedTenants value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withAllowedTenants(List allowedTenants) { + this.allowedTenants = allowedTenants; + return this; + } + + /** + * Get the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @param authority the authority value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signupPolicyName value. + */ + public String signupPolicyName() { + return this.signupPolicyName; + } + + /** + * Set the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signupPolicyName the signupPolicyName value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withSignupPolicyName(String signupPolicyName) { + this.signupPolicyName = signupPolicyName; + return this; + } + + /** + * Get the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signinPolicyName value. + */ + public String signinPolicyName() { + return this.signinPolicyName; + } + + /** + * Set the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signinPolicyName the signinPolicyName value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withSigninPolicyName(String signinPolicyName) { + this.signinPolicyName = signinPolicyName; + return this; + } + + /** + * Get the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @return the profileEditingPolicyName value. + */ + public String profileEditingPolicyName() { + return this.profileEditingPolicyName; + } + + /** + * Set the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @param profileEditingPolicyName the profileEditingPolicyName value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withProfileEditingPolicyName(String profileEditingPolicyName) { + this.profileEditingPolicyName = profileEditingPolicyName; + return this; + } + + /** + * Get the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the passwordResetPolicyName value. + */ + public String passwordResetPolicyName() { + return this.passwordResetPolicyName; + } + + /** + * Set the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param passwordResetPolicyName the passwordResetPolicyName value to set. + * @return the IdentityProviderBaseParameters object itself. + */ + public IdentityProviderBaseParameters withPasswordResetPolicyName(String passwordResetPolicyName) { + this.passwordResetPolicyName = passwordResetPolicyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContract.java new file mode 100644 index 0000000000000..47db29bb0e937 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContract.java @@ -0,0 +1,487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; +import java.util.List; + +/** An immutable client-side representation of IdentityProviderContract. */ +public interface IdentityProviderContract { + /** + * 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 typePropertiesType property: Identity Provider Type identifier. + * + * @return the typePropertiesType value. + */ + IdentityProviderType typePropertiesType(); + + /** + * Gets the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @return the signinTenant value. + */ + String signinTenant(); + + /** + * Gets the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @return the allowedTenants value. + */ + List allowedTenants(); + + /** + * Gets the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @return the authority value. + */ + String authority(); + + /** + * Gets the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signupPolicyName value. + */ + String signupPolicyName(); + + /** + * Gets the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signinPolicyName value. + */ + String signinPolicyName(); + + /** + * Gets the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @return the profileEditingPolicyName value. + */ + String profileEditingPolicyName(); + + /** + * Gets the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the passwordResetPolicyName value. + */ + String passwordResetPolicyName(); + + /** + * Gets the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + String clientId(); + + /** + * Gets the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the clientSecret value. + */ + String clientSecret(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner object. + * + * @return the inner object. + */ + IdentityProviderContractInner innerModel(); + + /** The entirety of the IdentityProviderContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IdentityProviderContract definition stages. */ + interface DefinitionStages { + /** The first stage of the IdentityProviderContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IdentityProviderContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the IdentityProviderContract 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.WithTypePropertiesType, + DefinitionStages.WithSigninTenant, + DefinitionStages.WithAllowedTenants, + DefinitionStages.WithAuthority, + DefinitionStages.WithSignupPolicyName, + DefinitionStages.WithSigninPolicyName, + DefinitionStages.WithProfileEditingPolicyName, + DefinitionStages.WithPasswordResetPolicyName, + DefinitionStages.WithClientId, + DefinitionStages.WithClientSecret, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + IdentityProviderContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IdentityProviderContract create(Context context); + } + /** The stage of the IdentityProviderContract definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Identity Provider Type identifier.. + * + * @param typePropertiesType Identity Provider Type identifier. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(IdentityProviderType typePropertiesType); + } + /** The stage of the IdentityProviderContract definition allowing to specify signinTenant. */ + interface WithSigninTenant { + /** + * Specifies the signinTenant property: The TenantId to use instead of Common when logging into Active + * Directory. + * + * @param signinTenant The TenantId to use instead of Common when logging into Active Directory. + * @return the next definition stage. + */ + WithCreate withSigninTenant(String signinTenant); + } + /** The stage of the IdentityProviderContract definition allowing to specify allowedTenants. */ + interface WithAllowedTenants { + /** + * Specifies the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory + * login.. + * + * @param allowedTenants List of Allowed Tenants when configuring Azure Active Directory login. + * @return the next definition stage. + */ + WithCreate withAllowedTenants(List allowedTenants); + } + /** The stage of the IdentityProviderContract definition allowing to specify authority. */ + interface WithAuthority { + /** + * Specifies the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.. + * + * @param authority OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * @return the next definition stage. + */ + WithCreate withAuthority(String authority); + } + /** The stage of the IdentityProviderContract definition allowing to specify signupPolicyName. */ + interface WithSignupPolicyName { + /** + * Specifies the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider.. + * + * @param signupPolicyName Signup Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + WithCreate withSignupPolicyName(String signupPolicyName); + } + /** The stage of the IdentityProviderContract definition allowing to specify signinPolicyName. */ + interface WithSigninPolicyName { + /** + * Specifies the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider.. + * + * @param signinPolicyName Signin Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + WithCreate withSigninPolicyName(String signinPolicyName); + } + /** The stage of the IdentityProviderContract definition allowing to specify profileEditingPolicyName. */ + interface WithProfileEditingPolicyName { + /** + * Specifies the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C + * Identity Provider.. + * + * @param profileEditingPolicyName Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + WithCreate withProfileEditingPolicyName(String profileEditingPolicyName); + } + /** The stage of the IdentityProviderContract definition allowing to specify passwordResetPolicyName. */ + interface WithPasswordResetPolicyName { + /** + * Specifies the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C + * Identity Provider.. + * + * @param passwordResetPolicyName Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + WithCreate withPasswordResetPolicyName(String passwordResetPolicyName); + } + /** The stage of the IdentityProviderContract definition allowing to specify clientId. */ + interface WithClientId { + /** + * Specifies the clientId property: Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for Microsoft.. + * + * @param clientId Client Id of the Application in the external Identity Provider. It is App ID for Facebook + * login, Client ID for Google login, App ID for Microsoft. + * @return the next definition stage. + */ + WithCreate withClientId(String clientId); + } + /** The stage of the IdentityProviderContract definition allowing to specify clientSecret. */ + interface WithClientSecret { + /** + * Specifies the clientSecret property: Client secret of the Application in external Identity Provider, used + * to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google + * login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' + * POST request to get the value.. + * + * @param clientSecret Client secret of the Application in external Identity Provider, used to authenticate + * login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key + * for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request + * to get the value. + * @return the next definition stage. + */ + WithCreate withClientSecret(String clientSecret); + } + /** The stage of the IdentityProviderContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the IdentityProviderContract resource. + * + * @return the stage of resource update. + */ + IdentityProviderContract.Update update(); + + /** The template for IdentityProviderContract update. */ + interface Update + extends UpdateStages.WithType, + UpdateStages.WithSigninTenant, + UpdateStages.WithAllowedTenants, + UpdateStages.WithAuthority, + UpdateStages.WithSignupPolicyName, + UpdateStages.WithSigninPolicyName, + UpdateStages.WithProfileEditingPolicyName, + UpdateStages.WithPasswordResetPolicyName, + UpdateStages.WithClientId, + UpdateStages.WithClientSecret, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IdentityProviderContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IdentityProviderContract apply(Context context); + } + /** The IdentityProviderContract update stages. */ + interface UpdateStages { + /** The stage of the IdentityProviderContract update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Identity Provider Type identifier.. + * + * @param type Identity Provider Type identifier. + * @return the next definition stage. + */ + Update withType(IdentityProviderType type); + } + /** The stage of the IdentityProviderContract update allowing to specify signinTenant. */ + interface WithSigninTenant { + /** + * Specifies the signinTenant property: The TenantId to use instead of Common when logging into Active + * Directory. + * + * @param signinTenant The TenantId to use instead of Common when logging into Active Directory. + * @return the next definition stage. + */ + Update withSigninTenant(String signinTenant); + } + /** The stage of the IdentityProviderContract update allowing to specify allowedTenants. */ + interface WithAllowedTenants { + /** + * Specifies the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory + * login.. + * + * @param allowedTenants List of Allowed Tenants when configuring Azure Active Directory login. + * @return the next definition stage. + */ + Update withAllowedTenants(List allowedTenants); + } + /** The stage of the IdentityProviderContract update allowing to specify authority. */ + interface WithAuthority { + /** + * Specifies the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C.. + * + * @param authority OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * @return the next definition stage. + */ + Update withAuthority(String authority); + } + /** The stage of the IdentityProviderContract update allowing to specify signupPolicyName. */ + interface WithSignupPolicyName { + /** + * Specifies the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider.. + * + * @param signupPolicyName Signup Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + Update withSignupPolicyName(String signupPolicyName); + } + /** The stage of the IdentityProviderContract update allowing to specify signinPolicyName. */ + interface WithSigninPolicyName { + /** + * Specifies the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider.. + * + * @param signinPolicyName Signin Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + Update withSigninPolicyName(String signinPolicyName); + } + /** The stage of the IdentityProviderContract update allowing to specify profileEditingPolicyName. */ + interface WithProfileEditingPolicyName { + /** + * Specifies the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C + * Identity Provider.. + * + * @param profileEditingPolicyName Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + Update withProfileEditingPolicyName(String profileEditingPolicyName); + } + /** The stage of the IdentityProviderContract update allowing to specify passwordResetPolicyName. */ + interface WithPasswordResetPolicyName { + /** + * Specifies the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C + * Identity Provider.. + * + * @param passwordResetPolicyName Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * @return the next definition stage. + */ + Update withPasswordResetPolicyName(String passwordResetPolicyName); + } + /** The stage of the IdentityProviderContract update allowing to specify clientId. */ + interface WithClientId { + /** + * Specifies the clientId property: Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for Microsoft.. + * + * @param clientId Client Id of the Application in the external Identity Provider. It is App ID for Facebook + * login, Client ID for Google login, App ID for Microsoft. + * @return the next definition stage. + */ + Update withClientId(String clientId); + } + /** The stage of the IdentityProviderContract update allowing to specify clientSecret. */ + interface WithClientSecret { + /** + * Specifies the clientSecret property: Client secret of the Application in external Identity Provider, used + * to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google + * login, Public Key for Microsoft.. + * + * @param clientSecret Client secret of the Application in external Identity Provider, used to authenticate + * login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key + * for Microsoft. + * @return the next definition stage. + */ + Update withClientSecret(String clientSecret); + } + /** The stage of the IdentityProviderContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IdentityProviderContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IdentityProviderContract refresh(Context context); + + /** + * Gets the client secret details of the Identity Provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + ClientSecretContract listSecrets(); + + /** + * Gets the client secret details of the Identity Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + Response listSecretsWithResponse(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContractProperties.java new file mode 100644 index 0000000000000..9a914042c7760 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderContractProperties.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.apimanagement.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 external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + * to enable access to the API Management service developer portal for all users. + */ +@Fluent +public final class IdentityProviderContractProperties extends IdentityProviderBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderContractProperties.class); + + /* + * Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for + * Microsoft. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook + * login, API Key for Google login, Public Key for Microsoft. This property + * will not be filled on 'GET' operations! Use '/listSecrets' POST request + * to get the value. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Get the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @param clientId the clientId value to set. + * @return the IdentityProviderContractProperties object itself. + */ + public IdentityProviderContractProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param clientSecret the clientSecret value to set. + * @return the IdentityProviderContractProperties object itself. + */ + public IdentityProviderContractProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withType(IdentityProviderType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withSigninTenant(String signinTenant) { + super.withSigninTenant(signinTenant); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withAllowedTenants(List allowedTenants) { + super.withAllowedTenants(allowedTenants); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withAuthority(String authority) { + super.withAuthority(authority); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withSignupPolicyName(String signupPolicyName) { + super.withSignupPolicyName(signupPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withSigninPolicyName(String signinPolicyName) { + super.withSigninPolicyName(signinPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withProfileEditingPolicyName(String profileEditingPolicyName) { + super.withProfileEditingPolicyName(profileEditingPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderContractProperties withPasswordResetPolicyName(String passwordResetPolicyName) { + super.withPasswordResetPolicyName(passwordResetPolicyName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (clientId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientId in model IdentityProviderContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContract.java new file mode 100644 index 0000000000000..4de5c6cca4787 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContract.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Identity Provider details. */ +@JsonFlatten +@Fluent +public class IdentityProviderCreateContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderCreateContract.class); + + /* + * Identity Provider Type identifier. + */ + @JsonProperty(value = "properties.type") + private IdentityProviderType typePropertiesType; + + /* + * The TenantId to use instead of Common when logging into Active Directory + */ + @JsonProperty(value = "properties.signinTenant") + private String signinTenant; + + /* + * List of Allowed Tenants when configuring Azure Active Directory login. + */ + @JsonProperty(value = "properties.allowedTenants") + private List allowedTenants; + + /* + * OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + */ + @JsonProperty(value = "properties.authority") + private String authority; + + /* + * Signup Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.signupPolicyName") + private String signupPolicyName; + + /* + * Signin Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.signinPolicyName") + private String signinPolicyName; + + /* + * Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.profileEditingPolicyName") + private String profileEditingPolicyName; + + /* + * Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.passwordResetPolicyName") + private String passwordResetPolicyName; + + /* + * Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for + * Microsoft. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook + * login, API Key for Google login, Public Key for Microsoft. This property + * will not be filled on 'GET' operations! Use '/listSecrets' POST request + * to get the value. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the typePropertiesType property: Identity Provider Type identifier. + * + * @return the typePropertiesType value. + */ + public IdentityProviderType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Identity Provider Type identifier. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withTypePropertiesType(IdentityProviderType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @return the signinTenant value. + */ + public String signinTenant() { + return this.signinTenant; + } + + /** + * Set the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @param signinTenant the signinTenant value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withSigninTenant(String signinTenant) { + this.signinTenant = signinTenant; + return this; + } + + /** + * Get the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @return the allowedTenants value. + */ + public List allowedTenants() { + return this.allowedTenants; + } + + /** + * Set the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @param allowedTenants the allowedTenants value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withAllowedTenants(List allowedTenants) { + this.allowedTenants = allowedTenants; + return this; + } + + /** + * Get the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @param authority the authority value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signupPolicyName value. + */ + public String signupPolicyName() { + return this.signupPolicyName; + } + + /** + * Set the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signupPolicyName the signupPolicyName value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withSignupPolicyName(String signupPolicyName) { + this.signupPolicyName = signupPolicyName; + return this; + } + + /** + * Get the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signinPolicyName value. + */ + public String signinPolicyName() { + return this.signinPolicyName; + } + + /** + * Set the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signinPolicyName the signinPolicyName value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withSigninPolicyName(String signinPolicyName) { + this.signinPolicyName = signinPolicyName; + return this; + } + + /** + * Get the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @return the profileEditingPolicyName value. + */ + public String profileEditingPolicyName() { + return this.profileEditingPolicyName; + } + + /** + * Set the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @param profileEditingPolicyName the profileEditingPolicyName value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withProfileEditingPolicyName(String profileEditingPolicyName) { + this.profileEditingPolicyName = profileEditingPolicyName; + return this; + } + + /** + * Get the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the passwordResetPolicyName value. + */ + public String passwordResetPolicyName() { + return this.passwordResetPolicyName; + } + + /** + * Set the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param passwordResetPolicyName the passwordResetPolicyName value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withPasswordResetPolicyName(String passwordResetPolicyName) { + this.passwordResetPolicyName = passwordResetPolicyName; + return this; + } + + /** + * Get the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @param clientId the clientId value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param clientSecret the clientSecret value to set. + * @return the IdentityProviderCreateContract object itself. + */ + public IdentityProviderCreateContract withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContractProperties.java new file mode 100644 index 0000000000000..db908b3381f4c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderCreateContractProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 external Identity Providers like Facebook, Google, Microsoft, Twitter or Azure Active Directory which can be used + * to enable access to the API Management service developer portal for all users. + */ +@Fluent +public final class IdentityProviderCreateContractProperties extends IdentityProviderBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderCreateContractProperties.class); + + /* + * Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for + * Microsoft. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook + * login, API Key for Google login, Public Key for Microsoft. This property + * will not be filled on 'GET' operations! Use '/listSecrets' POST request + * to get the value. + */ + @JsonProperty(value = "clientSecret", required = true) + private String clientSecret; + + /** + * Get the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @param clientId the clientId value to set. + * @return the IdentityProviderCreateContractProperties object itself. + */ + public IdentityProviderCreateContractProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param clientSecret the clientSecret value to set. + * @return the IdentityProviderCreateContractProperties object itself. + */ + public IdentityProviderCreateContractProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withType(IdentityProviderType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withSigninTenant(String signinTenant) { + super.withSigninTenant(signinTenant); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withAllowedTenants(List allowedTenants) { + super.withAllowedTenants(allowedTenants); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withAuthority(String authority) { + super.withAuthority(authority); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withSignupPolicyName(String signupPolicyName) { + super.withSignupPolicyName(signupPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withSigninPolicyName(String signinPolicyName) { + super.withSigninPolicyName(signinPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withProfileEditingPolicyName(String profileEditingPolicyName) { + super.withProfileEditingPolicyName(profileEditingPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderCreateContractProperties withPasswordResetPolicyName(String passwordResetPolicyName) { + super.withPasswordResetPolicyName(passwordResetPolicyName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (clientId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientId in model IdentityProviderCreateContractProperties")); + } + if (clientSecret() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientSecret in model IdentityProviderCreateContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderList.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderList.java new file mode 100644 index 0000000000000..c9720e92ff0b5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderList.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of all the Identity Providers configured on the service instance. */ +@Fluent +public final class IdentityProviderList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderList.class); + + /* + * Identity Provider configuration values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Identity Provider configuration values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Identity Provider configuration values. + * + * @param value the value value to set. + * @return the IdentityProviderList object itself. + */ + public IdentityProviderList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the IdentityProviderList object itself. + */ + public IdentityProviderList withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the IdentityProviderList object itself. + */ + public IdentityProviderList 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderType.java new file mode 100644 index 0000000000000..0d46bd42957e9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityProviderType. */ +public final class IdentityProviderType extends ExpandableStringEnum { + /** Static value facebook for IdentityProviderType. */ + public static final IdentityProviderType FACEBOOK = fromString("facebook"); + + /** Static value google for IdentityProviderType. */ + public static final IdentityProviderType GOOGLE = fromString("google"); + + /** Static value microsoft for IdentityProviderType. */ + public static final IdentityProviderType MICROSOFT = fromString("microsoft"); + + /** Static value twitter for IdentityProviderType. */ + public static final IdentityProviderType TWITTER = fromString("twitter"); + + /** Static value aad for IdentityProviderType. */ + public static final IdentityProviderType AAD = fromString("aad"); + + /** Static value aadB2C for IdentityProviderType. */ + public static final IdentityProviderType AAD_B2C = fromString("aadB2C"); + + /** + * Creates or finds a IdentityProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityProviderType. + */ + @JsonCreator + public static IdentityProviderType fromString(String name) { + return fromString(name, IdentityProviderType.class); + } + + /** @return known IdentityProviderType values. */ + public static Collection values() { + return values(IdentityProviderType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateParameters.java new file mode 100644 index 0000000000000..869c72a85dfbb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateParameters.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters supplied to update Identity Provider. */ +@JsonFlatten +@Fluent +public class IdentityProviderUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderUpdateParameters.class); + + /* + * Identity Provider Type identifier. + */ + @JsonProperty(value = "properties.type") + private IdentityProviderType type; + + /* + * The TenantId to use instead of Common when logging into Active Directory + */ + @JsonProperty(value = "properties.signinTenant") + private String signinTenant; + + /* + * List of Allowed Tenants when configuring Azure Active Directory login. + */ + @JsonProperty(value = "properties.allowedTenants") + private List allowedTenants; + + /* + * OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + */ + @JsonProperty(value = "properties.authority") + private String authority; + + /* + * Signup Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.signupPolicyName") + private String signupPolicyName; + + /* + * Signin Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.signinPolicyName") + private String signinPolicyName; + + /* + * Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.profileEditingPolicyName") + private String profileEditingPolicyName; + + /* + * Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + */ + @JsonProperty(value = "properties.passwordResetPolicyName") + private String passwordResetPolicyName; + + /* + * Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for + * Microsoft. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook + * login, API Key for Google login, Public Key for Microsoft. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the type property: Identity Provider Type identifier. + * + * @return the type value. + */ + public IdentityProviderType type() { + return this.type; + } + + /** + * Set the type property: Identity Provider Type identifier. + * + * @param type the type value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withType(IdentityProviderType type) { + this.type = type; + return this; + } + + /** + * Get the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @return the signinTenant value. + */ + public String signinTenant() { + return this.signinTenant; + } + + /** + * Set the signinTenant property: The TenantId to use instead of Common when logging into Active Directory. + * + * @param signinTenant the signinTenant value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withSigninTenant(String signinTenant) { + this.signinTenant = signinTenant; + return this; + } + + /** + * Get the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @return the allowedTenants value. + */ + public List allowedTenants() { + return this.allowedTenants; + } + + /** + * Set the allowedTenants property: List of Allowed Tenants when configuring Azure Active Directory login. + * + * @param allowedTenants the allowedTenants value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withAllowedTenants(List allowedTenants) { + this.allowedTenants = allowedTenants; + return this; + } + + /** + * Get the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + * + * @param authority the authority value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signupPolicyName value. + */ + public String signupPolicyName() { + return this.signupPolicyName; + } + + /** + * Set the signupPolicyName property: Signup Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signupPolicyName the signupPolicyName value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withSignupPolicyName(String signupPolicyName) { + this.signupPolicyName = signupPolicyName; + return this; + } + + /** + * Get the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the signinPolicyName value. + */ + public String signinPolicyName() { + return this.signinPolicyName; + } + + /** + * Set the signinPolicyName property: Signin Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param signinPolicyName the signinPolicyName value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withSigninPolicyName(String signinPolicyName) { + this.signinPolicyName = signinPolicyName; + return this; + } + + /** + * Get the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @return the profileEditingPolicyName value. + */ + public String profileEditingPolicyName() { + return this.profileEditingPolicyName; + } + + /** + * Set the profileEditingPolicyName property: Profile Editing Policy Name. Only applies to AAD B2C Identity + * Provider. + * + * @param profileEditingPolicyName the profileEditingPolicyName value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withProfileEditingPolicyName(String profileEditingPolicyName) { + this.profileEditingPolicyName = profileEditingPolicyName; + return this; + } + + /** + * Get the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @return the passwordResetPolicyName value. + */ + public String passwordResetPolicyName() { + return this.passwordResetPolicyName; + } + + /** + * Set the passwordResetPolicyName property: Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + * + * @param passwordResetPolicyName the passwordResetPolicyName value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withPasswordResetPolicyName(String passwordResetPolicyName) { + this.passwordResetPolicyName = passwordResetPolicyName; + return this; + } + + /** + * Get the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @param clientId the clientId value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. + * + * @param clientSecret the clientSecret value to set. + * @return the IdentityProviderUpdateParameters object itself. + */ + public IdentityProviderUpdateParameters withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateProperties.java new file mode 100644 index 0000000000000..80cb1b3ccf276 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviderUpdateProperties.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 supplied to the Update Identity Provider operation. */ +@Fluent +public final class IdentityProviderUpdateProperties extends IdentityProviderBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviderUpdateProperties.class); + + /* + * Client Id of the Application in the external Identity Provider. It is + * App ID for Facebook login, Client ID for Google login, App ID for + * Microsoft. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook + * login, API Key for Google login, Public Key for Microsoft. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Get the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id of the Application in the external Identity Provider. It is App ID for + * Facebook login, Client ID for Google login, App ID for Microsoft. + * + * @param clientId the clientId value to set. + * @return the IdentityProviderUpdateProperties object itself. + */ + public IdentityProviderUpdateProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client secret of the Application in external Identity Provider, used to + * authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public + * Key for Microsoft. + * + * @param clientSecret the clientSecret value to set. + * @return the IdentityProviderUpdateProperties object itself. + */ + public IdentityProviderUpdateProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withType(IdentityProviderType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withSigninTenant(String signinTenant) { + super.withSigninTenant(signinTenant); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withAllowedTenants(List allowedTenants) { + super.withAllowedTenants(allowedTenants); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withAuthority(String authority) { + super.withAuthority(authority); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withSignupPolicyName(String signupPolicyName) { + super.withSignupPolicyName(signupPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withSigninPolicyName(String signinPolicyName) { + super.withSigninPolicyName(signinPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withProfileEditingPolicyName(String profileEditingPolicyName) { + super.withProfileEditingPolicyName(profileEditingPolicyName); + return this; + } + + /** {@inheritDoc} */ + @Override + public IdentityProviderUpdateProperties withPasswordResetPolicyName(String passwordResetPolicyName) { + super.withPasswordResetPolicyName(passwordResetPolicyName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviders.java new file mode 100644 index 0000000000000..1fdbbf3a7390a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProviders.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.apimanagement.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 IdentityProviders. */ +public interface IdentityProviders { + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 all the Identity Providers configured on the service instance. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of Identity Provider configured in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 all the Identity Providers configured on the service instance. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, IdentityProviderType identityProviderName); + + /** + * Gets the entity state (Etag) version of the identityProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the identityProvider specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context); + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + IdentityProviderContract get( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName); + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context); + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, IdentityProviderType identityProviderName, String ifMatch); + + /** + * Deletes the specified identity provider configuration. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + IdentityProviderType identityProviderName, + String ifMatch, + Context context); + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + ClientSecretContract listSecrets( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName); + + /** + * Gets the client secret details of the Identity Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param identityProviderName Identity Provider Type identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the Identity Provider. + */ + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, IdentityProviderType identityProviderName, Context context); + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + IdentityProviderContract getById(String id); + + /** + * Gets the configuration details of the identity Provider configured in specified service instance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration details of the identity Provider configured in specified service instance. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified identity provider configuration. + * + * @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 the specified identity provider configuration. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new IdentityProviderContract resource. + * + * @param name resource name. + * @return the first stage of the new IdentityProviderContract definition. + */ + IdentityProviderContract.DefinitionStages.Blank define(IdentityProviderType name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..0a0b7bdd540eb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateHeaders.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.apimanagement.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 IdentityProvidersCreateOrUpdateHeaders model. */ +@Fluent +public final class IdentityProvidersCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProvidersCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the IdentityProvidersCreateOrUpdateHeaders object itself. + */ + public IdentityProvidersCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..9f8fc50bbf785 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class IdentityProvidersCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of IdentityProvidersCreateOrUpdateResponse. + * + * @param request the request which resulted in this IdentityProvidersCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public IdentityProvidersCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IdentityProviderContractInner value, + IdentityProvidersCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IdentityProviderContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagHeaders.java new file mode 100644 index 0000000000000..9db777551747b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagHeaders.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.apimanagement.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 IdentityProvidersGetEntityTagHeaders model. */ +@Fluent +public final class IdentityProvidersGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProvidersGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the IdentityProvidersGetEntityTagHeaders object itself. + */ + public IdentityProvidersGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagResponse.java new file mode 100644 index 0000000000000..b0187fae04d9a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class IdentityProvidersGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of IdentityProvidersGetEntityTagResponse. + * + * @param request the request which resulted in this IdentityProvidersGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public IdentityProvidersGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + IdentityProvidersGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetHeaders.java new file mode 100644 index 0000000000000..5ecc4808631fb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetHeaders.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.apimanagement.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 IdentityProvidersGetHeaders model. */ +@Fluent +public final class IdentityProvidersGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProvidersGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the IdentityProvidersGetHeaders object itself. + */ + public IdentityProvidersGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetResponse.java new file mode 100644 index 0000000000000..bb366869bc8e3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; + +/** Contains all response data for the get operation. */ +public final class IdentityProvidersGetResponse + extends ResponseBase { + /** + * Creates an instance of IdentityProvidersGetResponse. + * + * @param request the request which resulted in this IdentityProvidersGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public IdentityProvidersGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IdentityProviderContractInner value, + IdentityProvidersGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IdentityProviderContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsHeaders.java new file mode 100644 index 0000000000000..03c345b39047c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsHeaders.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.apimanagement.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 IdentityProvidersListSecretsHeaders model. */ +@Fluent +public final class IdentityProvidersListSecretsHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProvidersListSecretsHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the IdentityProvidersListSecretsHeaders object itself. + */ + public IdentityProvidersListSecretsHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsResponse.java new file mode 100644 index 0000000000000..0fe3e30b42db7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersListSecretsResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; + +/** Contains all response data for the listSecrets operation. */ +public final class IdentityProvidersListSecretsResponse + extends ResponseBase { + /** + * Creates an instance of IdentityProvidersListSecretsResponse. + * + * @param request the request which resulted in this IdentityProvidersListSecretsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public IdentityProvidersListSecretsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ClientSecretContractInner value, + IdentityProvidersListSecretsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ClientSecretContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateHeaders.java new file mode 100644 index 0000000000000..8563f82419026 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateHeaders.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.apimanagement.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 IdentityProvidersUpdateHeaders model. */ +@Fluent +public final class IdentityProvidersUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProvidersUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the IdentityProvidersUpdateHeaders object itself. + */ + public IdentityProvidersUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateResponse.java new file mode 100644 index 0000000000000..3a99bedb3c6c6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IdentityProvidersUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IdentityProviderContractInner; + +/** Contains all response data for the update operation. */ +public final class IdentityProvidersUpdateResponse + extends ResponseBase { + /** + * Creates an instance of IdentityProvidersUpdateResponse. + * + * @param request the request which resulted in this IdentityProvidersUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public IdentityProvidersUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IdentityProviderContractInner value, + IdentityProvidersUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IdentityProviderContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentCollection.java new file mode 100644 index 0000000000000..8896683efa2be --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Issue Attachment list representation. */ +@Fluent +public final class IssueAttachmentCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueAttachmentCollection.class); + + /* + * Issue Attachment values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Issue Attachment values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the IssueAttachmentCollection object itself. + */ + public IssueAttachmentCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentContract.java new file mode 100644 index 0000000000000..45faee8607561 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueAttachmentContract.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner; + +/** An immutable client-side representation of IssueAttachmentContract. */ +public interface IssueAttachmentContract { + /** + * 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 title property: Filename by which the binary data will be saved. + * + * @return the title value. + */ + String title(); + + /** + * Gets the contentFormat property: Either 'link' if content is provided via an HTTP link or the MIME type of the + * Base64-encoded binary data provided in the 'content' property. + * + * @return the contentFormat value. + */ + String contentFormat(); + + /** + * Gets the content property: An HTTP link or Base64-encoded binary data. + * + * @return the content value. + */ + String content(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.IssueAttachmentContractInner object. + * + * @return the inner object. + */ + IssueAttachmentContractInner innerModel(); + + /** The entirety of the IssueAttachmentContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IssueAttachmentContract definition stages. */ + interface DefinitionStages { + /** The first stage of the IssueAttachmentContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IssueAttachmentContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId, issueId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @return the next definition stage. + */ + WithCreate withExistingIssue(String resourceGroupName, String serviceName, String apiId, String issueId); + } + /** + * The stage of the IssueAttachmentContract 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.WithTitle, + DefinitionStages.WithContentFormat, + DefinitionStages.WithContent, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + IssueAttachmentContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IssueAttachmentContract create(Context context); + } + /** The stage of the IssueAttachmentContract definition allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: Filename by which the binary data will be saved.. + * + * @param title Filename by which the binary data will be saved. + * @return the next definition stage. + */ + WithCreate withTitle(String title); + } + /** The stage of the IssueAttachmentContract definition allowing to specify contentFormat. */ + interface WithContentFormat { + /** + * Specifies the contentFormat property: Either 'link' if content is provided via an HTTP link or the MIME + * type of the Base64-encoded binary data provided in the 'content' property.. + * + * @param contentFormat Either 'link' if content is provided via an HTTP link or the MIME type of the + * Base64-encoded binary data provided in the 'content' property. + * @return the next definition stage. + */ + WithCreate withContentFormat(String contentFormat); + } + /** The stage of the IssueAttachmentContract definition allowing to specify content. */ + interface WithContent { + /** + * Specifies the content property: An HTTP link or Base64-encoded binary data.. + * + * @param content An HTTP link or Base64-encoded binary data. + * @return the next definition stage. + */ + WithCreate withContent(String content); + } + /** The stage of the IssueAttachmentContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the IssueAttachmentContract resource. + * + * @return the stage of resource update. + */ + IssueAttachmentContract.Update update(); + + /** The template for IssueAttachmentContract update. */ + interface Update + extends UpdateStages.WithTitle, + UpdateStages.WithContentFormat, + UpdateStages.WithContent, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IssueAttachmentContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IssueAttachmentContract apply(Context context); + } + /** The IssueAttachmentContract update stages. */ + interface UpdateStages { + /** The stage of the IssueAttachmentContract update allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: Filename by which the binary data will be saved.. + * + * @param title Filename by which the binary data will be saved. + * @return the next definition stage. + */ + Update withTitle(String title); + } + /** The stage of the IssueAttachmentContract update allowing to specify contentFormat. */ + interface WithContentFormat { + /** + * Specifies the contentFormat property: Either 'link' if content is provided via an HTTP link or the MIME + * type of the Base64-encoded binary data provided in the 'content' property.. + * + * @param contentFormat Either 'link' if content is provided via an HTTP link or the MIME type of the + * Base64-encoded binary data provided in the 'content' property. + * @return the next definition stage. + */ + Update withContentFormat(String contentFormat); + } + /** The stage of the IssueAttachmentContract update allowing to specify content. */ + interface WithContent { + /** + * Specifies the content property: An HTTP link or Base64-encoded binary data.. + * + * @param content An HTTP link or Base64-encoded binary data. + * @return the next definition stage. + */ + Update withContent(String content); + } + /** The stage of the IssueAttachmentContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IssueAttachmentContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IssueAttachmentContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCollection.java new file mode 100644 index 0000000000000..66665da201216 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Issue list representation. */ +@Fluent +public final class IssueCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueCollection.class); + + /* + * Issue values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Issue values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the IssueCollection object itself. + */ + public IssueCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentCollection.java new file mode 100644 index 0000000000000..5b417eda61291 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Issue Comment list representation. */ +@Fluent +public final class IssueCommentCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueCommentCollection.class); + + /* + * Issue Comment values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Issue Comment values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the IssueCommentCollection object itself. + */ + public IssueCommentCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentContract.java new file mode 100644 index 0000000000000..27d39d1d3485e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueCommentContract.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of IssueCommentContract. */ +public interface IssueCommentContract { + /** + * 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 text property: Comment text. + * + * @return the text value. + */ + String text(); + + /** + * Gets the createdDate property: Date and time when the comment was created. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the userId property: A resource identifier for the user who left the comment. + * + * @return the userId value. + */ + String userId(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.IssueCommentContractInner object. + * + * @return the inner object. + */ + IssueCommentContractInner innerModel(); + + /** The entirety of the IssueCommentContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IssueCommentContract definition stages. */ + interface DefinitionStages { + /** The first stage of the IssueCommentContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IssueCommentContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId, issueId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @return the next definition stage. + */ + WithCreate withExistingIssue(String resourceGroupName, String serviceName, String apiId, String issueId); + } + /** + * The stage of the IssueCommentContract 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.WithText, + DefinitionStages.WithCreatedDate, + DefinitionStages.WithUserId, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + IssueCommentContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IssueCommentContract create(Context context); + } + /** The stage of the IssueCommentContract definition allowing to specify text. */ + interface WithText { + /** + * Specifies the text property: Comment text.. + * + * @param text Comment text. + * @return the next definition stage. + */ + WithCreate withText(String text); + } + /** The stage of the IssueCommentContract definition allowing to specify createdDate. */ + interface WithCreatedDate { + /** + * Specifies the createdDate property: Date and time when the comment was created.. + * + * @param createdDate Date and time when the comment was created. + * @return the next definition stage. + */ + WithCreate withCreatedDate(OffsetDateTime createdDate); + } + /** The stage of the IssueCommentContract definition allowing to specify userId. */ + interface WithUserId { + /** + * Specifies the userId property: A resource identifier for the user who left the comment.. + * + * @param userId A resource identifier for the user who left the comment. + * @return the next definition stage. + */ + WithCreate withUserId(String userId); + } + /** The stage of the IssueCommentContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the IssueCommentContract resource. + * + * @return the stage of resource update. + */ + IssueCommentContract.Update update(); + + /** The template for IssueCommentContract update. */ + interface Update + extends UpdateStages.WithText, UpdateStages.WithCreatedDate, UpdateStages.WithUserId, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IssueCommentContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IssueCommentContract apply(Context context); + } + /** The IssueCommentContract update stages. */ + interface UpdateStages { + /** The stage of the IssueCommentContract update allowing to specify text. */ + interface WithText { + /** + * Specifies the text property: Comment text.. + * + * @param text Comment text. + * @return the next definition stage. + */ + Update withText(String text); + } + /** The stage of the IssueCommentContract update allowing to specify createdDate. */ + interface WithCreatedDate { + /** + * Specifies the createdDate property: Date and time when the comment was created.. + * + * @param createdDate Date and time when the comment was created. + * @return the next definition stage. + */ + Update withCreatedDate(OffsetDateTime createdDate); + } + /** The stage of the IssueCommentContract update allowing to specify userId. */ + interface WithUserId { + /** + * Specifies the userId property: A resource identifier for the user who left the comment.. + * + * @param userId A resource identifier for the user who left the comment. + * @return the next definition stage. + */ + Update withUserId(String userId); + } + /** The stage of the IssueCommentContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IssueCommentContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IssueCommentContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContract.java new file mode 100644 index 0000000000000..b418fcf3fefde --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContract.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of IssueContract. */ +public interface IssueContract { + /** + * 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 createdDate property: Date and time when the issue was created. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the state property: Status of the issue. + * + * @return the state value. + */ + State state(); + + /** + * Gets the apiId property: A resource identifier for the API the issue was created for. + * + * @return the apiId value. + */ + String apiId(); + + /** + * Gets the title property: The issue title. + * + * @return the title value. + */ + String title(); + + /** + * Gets the description property: Text describing the issue. + * + * @return the description value. + */ + String description(); + + /** + * Gets the userId property: A resource identifier for the user created the issue. + * + * @return the userId value. + */ + String userId(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner object. + * + * @return the inner object. + */ + IssueContractInner innerModel(); + + /** The entirety of the IssueContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IssueContract definition stages. */ + interface DefinitionStages { + /** The first stage of the IssueContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IssueContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API identifier. Must be unique in the current API Management service instance. + * @return the next definition stage. + */ + WithCreate withExistingApi(String resourceGroupName, String serviceName, String apiId); + } + /** + * The stage of the IssueContract 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.WithCreatedDate, + DefinitionStages.WithState, + DefinitionStages.WithApiId, + DefinitionStages.WithTitle, + DefinitionStages.WithDescription, + DefinitionStages.WithUserId, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + IssueContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IssueContract create(Context context); + } + /** The stage of the IssueContract definition allowing to specify createdDate. */ + interface WithCreatedDate { + /** + * Specifies the createdDate property: Date and time when the issue was created.. + * + * @param createdDate Date and time when the issue was created. + * @return the next definition stage. + */ + WithCreate withCreatedDate(OffsetDateTime createdDate); + } + /** The stage of the IssueContract definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Status of the issue.. + * + * @param state Status of the issue. + * @return the next definition stage. + */ + WithCreate withState(State state); + } + /** The stage of the IssueContract definition allowing to specify apiId. */ + interface WithApiId { + /** + * Specifies the apiId property: A resource identifier for the API the issue was created for.. + * + * @param apiId A resource identifier for the API the issue was created for. + * @return the next definition stage. + */ + WithCreate withApiId(String apiId); + } + /** The stage of the IssueContract definition allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: The issue title.. + * + * @param title The issue title. + * @return the next definition stage. + */ + WithCreate withTitle(String title); + } + /** The stage of the IssueContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Text describing the issue.. + * + * @param description Text describing the issue. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the IssueContract definition allowing to specify userId. */ + interface WithUserId { + /** + * Specifies the userId property: A resource identifier for the user created the issue.. + * + * @param userId A resource identifier for the user created the issue. + * @return the next definition stage. + */ + WithCreate withUserId(String userId); + } + /** The stage of the IssueContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the IssueContract resource. + * + * @return the stage of resource update. + */ + IssueContract.Update update(); + + /** The template for IssueContract update. */ + interface Update + extends UpdateStages.WithCreatedDate, + UpdateStages.WithState, + UpdateStages.WithApiId, + UpdateStages.WithTitle, + UpdateStages.WithDescription, + UpdateStages.WithUserId, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IssueContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IssueContract apply(Context context); + } + /** The IssueContract update stages. */ + interface UpdateStages { + /** The stage of the IssueContract update allowing to specify createdDate. */ + interface WithCreatedDate { + /** + * Specifies the createdDate property: Date and time when the issue was created.. + * + * @param createdDate Date and time when the issue was created. + * @return the next definition stage. + */ + Update withCreatedDate(OffsetDateTime createdDate); + } + /** The stage of the IssueContract update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Status of the issue.. + * + * @param state Status of the issue. + * @return the next definition stage. + */ + Update withState(State state); + } + /** The stage of the IssueContract update allowing to specify apiId. */ + interface WithApiId { + /** + * Specifies the apiId property: A resource identifier for the API the issue was created for.. + * + * @param apiId A resource identifier for the API the issue was created for. + * @return the next definition stage. + */ + Update withApiId(String apiId); + } + /** The stage of the IssueContract update allowing to specify title. */ + interface WithTitle { + /** + * Specifies the title property: The issue title.. + * + * @param title The issue title. + * @return the next definition stage. + */ + Update withTitle(String title); + } + /** The stage of the IssueContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Text describing the issue.. + * + * @param description Text describing the issue. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the IssueContract update allowing to specify userId. */ + interface WithUserId { + /** + * Specifies the userId property: A resource identifier for the user created the issue.. + * + * @param userId A resource identifier for the user created the issue. + * @return the next definition stage. + */ + Update withUserId(String userId); + } + /** The stage of the IssueContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IssueContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IssueContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractBaseProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractBaseProperties.java new file mode 100644 index 0000000000000..5038b3184f883 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractBaseProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Issue contract Base Properties. */ +@Fluent +public class IssueContractBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueContractBaseProperties.class); + + /* + * Date and time when the issue was created. + */ + @JsonProperty(value = "createdDate") + private OffsetDateTime createdDate; + + /* + * Status of the issue. + */ + @JsonProperty(value = "state") + private State state; + + /* + * A resource identifier for the API the issue was created for. + */ + @JsonProperty(value = "apiId") + private String apiId; + + /** + * Get the createdDate property: Date and time when the issue was created. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: Date and time when the issue was created. + * + * @param createdDate the createdDate value to set. + * @return the IssueContractBaseProperties object itself. + */ + public IssueContractBaseProperties withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state property: Status of the issue. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Status of the issue. + * + * @param state the state value to set. + * @return the IssueContractBaseProperties object itself. + */ + public IssueContractBaseProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the apiId property: A resource identifier for the API the issue was created for. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: A resource identifier for the API the issue was created for. + * + * @param apiId the apiId value to set. + * @return the IssueContractBaseProperties object itself. + */ + public IssueContractBaseProperties withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractProperties.java new file mode 100644 index 0000000000000..7667dd789932a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueContractProperties.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Issue contract Properties. */ +@Fluent +public final class IssueContractProperties extends IssueContractBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueContractProperties.class); + + /* + * The issue title. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * Text describing the issue. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * A resource identifier for the user created the issue. + */ + @JsonProperty(value = "userId", required = true) + private String userId; + + /** + * Get the title property: The issue title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The issue title. + * + * @param title the title value to set. + * @return the IssueContractProperties object itself. + */ + public IssueContractProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Text describing the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text describing the issue. + * + * @param description the description value to set. + * @return the IssueContractProperties object itself. + */ + public IssueContractProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the userId property: A resource identifier for the user created the issue. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: A resource identifier for the user created the issue. + * + * @param userId the userId value to set. + * @return the IssueContractProperties object itself. + */ + public IssueContractProperties withUserId(String userId) { + this.userId = userId; + return this; + } + + /** {@inheritDoc} */ + @Override + public IssueContractProperties withCreatedDate(OffsetDateTime createdDate) { + super.withCreatedDate(createdDate); + return this; + } + + /** {@inheritDoc} */ + @Override + public IssueContractProperties withState(State state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public IssueContractProperties withApiId(String apiId) { + super.withApiId(apiId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (title() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property title in model IssueContractProperties")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model IssueContractProperties")); + } + if (userId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property userId in model IssueContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContract.java new file mode 100644 index 0000000000000..c5c0f32502d86 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContract.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.apimanagement.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.time.OffsetDateTime; + +/** Issue update Parameters. */ +@JsonFlatten +@Fluent +public class IssueUpdateContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueUpdateContract.class); + + /* + * Date and time when the issue was created. + */ + @JsonProperty(value = "properties.createdDate") + private OffsetDateTime createdDate; + + /* + * Status of the issue. + */ + @JsonProperty(value = "properties.state") + private State state; + + /* + * A resource identifier for the API the issue was created for. + */ + @JsonProperty(value = "properties.apiId") + private String apiId; + + /* + * The issue title. + */ + @JsonProperty(value = "properties.title") + private String title; + + /* + * Text describing the issue. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * A resource identifier for the user created the issue. + */ + @JsonProperty(value = "properties.userId") + private String userId; + + /** + * Get the createdDate property: Date and time when the issue was created. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: Date and time when the issue was created. + * + * @param createdDate the createdDate value to set. + * @return the IssueUpdateContract object itself. + */ + public IssueUpdateContract withCreatedDate(OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state property: Status of the issue. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Status of the issue. + * + * @param state the state value to set. + * @return the IssueUpdateContract object itself. + */ + public IssueUpdateContract withState(State state) { + this.state = state; + return this; + } + + /** + * Get the apiId property: A resource identifier for the API the issue was created for. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: A resource identifier for the API the issue was created for. + * + * @param apiId the apiId value to set. + * @return the IssueUpdateContract object itself. + */ + public IssueUpdateContract withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Get the title property: The issue title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The issue title. + * + * @param title the title value to set. + * @return the IssueUpdateContract object itself. + */ + public IssueUpdateContract withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Text describing the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text describing the issue. + * + * @param description the description value to set. + * @return the IssueUpdateContract object itself. + */ + public IssueUpdateContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the userId property: A resource identifier for the user created the issue. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: A resource identifier for the user created the issue. + * + * @param userId the userId value to set. + * @return the IssueUpdateContract object itself. + */ + public IssueUpdateContract withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContractProperties.java new file mode 100644 index 0000000000000..4322a632f868b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssueUpdateContractProperties.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Issue contract Update Properties. */ +@Fluent +public final class IssueUpdateContractProperties extends IssueContractBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssueUpdateContractProperties.class); + + /* + * The issue title. + */ + @JsonProperty(value = "title") + private String title; + + /* + * Text describing the issue. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A resource identifier for the user created the issue. + */ + @JsonProperty(value = "userId") + private String userId; + + /** + * Get the title property: The issue title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The issue title. + * + * @param title the title value to set. + * @return the IssueUpdateContractProperties object itself. + */ + public IssueUpdateContractProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Text describing the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text describing the issue. + * + * @param description the description value to set. + * @return the IssueUpdateContractProperties object itself. + */ + public IssueUpdateContractProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the userId property: A resource identifier for the user created the issue. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: A resource identifier for the user created the issue. + * + * @param userId the userId value to set. + * @return the IssueUpdateContractProperties object itself. + */ + public IssueUpdateContractProperties withUserId(String userId) { + this.userId = userId; + return this; + } + + /** {@inheritDoc} */ + @Override + public IssueUpdateContractProperties withCreatedDate(OffsetDateTime createdDate) { + super.withCreatedDate(createdDate); + return this; + } + + /** {@inheritDoc} */ + @Override + public IssueUpdateContractProperties withState(State state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public IssueUpdateContractProperties withApiId(String apiId) { + super.withApiId(apiId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Issues.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Issues.java new file mode 100644 index 0000000000000..f95fefd9e9324 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Issues.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Issues. */ +public interface Issues { + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of issues in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| apiId | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| title | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| authorName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Issue list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + IssueContract get(String resourceGroupName, String serviceName, String issueId); + + /** + * Gets API Management issue details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param issueId Issue identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI Management issue details. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String issueId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetHeaders.java new file mode 100644 index 0000000000000..e6b495c903c4b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetHeaders.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.apimanagement.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 IssuesGetHeaders model. */ +@Fluent +public final class IssuesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IssuesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the IssuesGetHeaders object itself. + */ + public IssuesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetResponse.java new file mode 100644 index 0000000000000..45a17bcbec552 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/IssuesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.IssueContractInner; + +/** Contains all response data for the get operation. */ +public final class IssuesGetResponse extends ResponseBase { + /** + * Creates an instance of IssuesGetResponse. + * + * @param request the request which resulted in this IssuesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public IssuesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + IssueContractInner value, + IssuesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public IssueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyType.java new file mode 100644 index 0000000000000..901a7c4afbf92 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyType.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for KeyType. */ +public enum KeyType { + /** Enum value primary. */ + PRIMARY("primary"), + + /** Enum value secondary. */ + SECONDARY("secondary"); + + /** The actual serialized value for a KeyType instance. */ + private final String value; + + KeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyType object, or null if unable to parse. + */ + @JsonCreator + public static KeyType fromString(String value) { + KeyType[] items = KeyType.values(); + for (KeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractCreateProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractCreateProperties.java new file mode 100644 index 0000000000000..1c8689202868f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractCreateProperties.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.apimanagement.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; + +/** Create keyVault contract details. */ +@Fluent +public class KeyVaultContractCreateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultContractCreateProperties.class); + + /* + * Key vault secret identifier for fetching secret. Providing a versioned + * secret will prevent auto-refresh. This requires Api Management service + * to be configured with aka.ms/apimmsi + */ + @JsonProperty(value = "secretIdentifier") + private String secretIdentifier; + + /* + * SystemAssignedIdentity or UserAssignedIdentity Client Id which will be + * used to access key vault secret. + */ + @JsonProperty(value = "identityClientId") + private String identityClientId; + + /** + * Get the secretIdentifier property: Key vault secret identifier for fetching secret. Providing a versioned secret + * will prevent auto-refresh. This requires Api Management service to be configured with aka.ms/apimmsi. + * + * @return the secretIdentifier value. + */ + public String secretIdentifier() { + return this.secretIdentifier; + } + + /** + * Set the secretIdentifier property: Key vault secret identifier for fetching secret. Providing a versioned secret + * will prevent auto-refresh. This requires Api Management service to be configured with aka.ms/apimmsi. + * + * @param secretIdentifier the secretIdentifier value to set. + * @return the KeyVaultContractCreateProperties object itself. + */ + public KeyVaultContractCreateProperties withSecretIdentifier(String secretIdentifier) { + this.secretIdentifier = secretIdentifier; + return this; + } + + /** + * Get the identityClientId property: SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to + * access key vault secret. + * + * @return the identityClientId value. + */ + public String identityClientId() { + return this.identityClientId; + } + + /** + * Set the identityClientId property: SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to + * access key vault secret. + * + * @param identityClientId the identityClientId value to set. + * @return the KeyVaultContractCreateProperties object itself. + */ + public KeyVaultContractCreateProperties withIdentityClientId(String identityClientId) { + this.identityClientId = identityClientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractProperties.java new file mode 100644 index 0000000000000..6a13c2c6c2536 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultContractProperties.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.apimanagement.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; + +/** KeyVault contract details. */ +@Fluent +public final class KeyVaultContractProperties extends KeyVaultContractCreateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultContractProperties.class); + + /* + * Last time sync and refresh status of secret from key vault. + */ + @JsonProperty(value = "lastStatus") + private KeyVaultLastAccessStatusContractProperties lastStatus; + + /** + * Get the lastStatus property: Last time sync and refresh status of secret from key vault. + * + * @return the lastStatus value. + */ + public KeyVaultLastAccessStatusContractProperties lastStatus() { + return this.lastStatus; + } + + /** + * Set the lastStatus property: Last time sync and refresh status of secret from key vault. + * + * @param lastStatus the lastStatus value to set. + * @return the KeyVaultContractProperties object itself. + */ + public KeyVaultContractProperties withLastStatus(KeyVaultLastAccessStatusContractProperties lastStatus) { + this.lastStatus = lastStatus; + return this; + } + + /** {@inheritDoc} */ + @Override + public KeyVaultContractProperties withSecretIdentifier(String secretIdentifier) { + super.withSecretIdentifier(secretIdentifier); + return this; + } + + /** {@inheritDoc} */ + @Override + public KeyVaultContractProperties withIdentityClientId(String identityClientId) { + super.withIdentityClientId(identityClientId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (lastStatus() != null) { + lastStatus().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultLastAccessStatusContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultLastAccessStatusContractProperties.java new file mode 100644 index 0000000000000..015c73a7022ec --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/KeyVaultLastAccessStatusContractProperties.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Issue contract Update Properties. */ +@Fluent +public final class KeyVaultLastAccessStatusContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultLastAccessStatusContractProperties.class); + + /* + * Last status code for sync and refresh of secret from key vault. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Details of the error else empty. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Last time secret was accessed. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "timeStampUtc") + private OffsetDateTime timestampUtc; + + /** + * Get the code property: Last status code for sync and refresh of secret from key vault. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Last status code for sync and refresh of secret from key vault. + * + * @param code the code value to set. + * @return the KeyVaultLastAccessStatusContractProperties object itself. + */ + public KeyVaultLastAccessStatusContractProperties withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Details of the error else empty. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Details of the error else empty. + * + * @param message the message value to set. + * @return the KeyVaultLastAccessStatusContractProperties object itself. + */ + public KeyVaultLastAccessStatusContractProperties withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the timestampUtc property: Last time secret was accessed. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the timestampUtc value. + */ + public OffsetDateTime timestampUtc() { + return this.timestampUtc; + } + + /** + * Set the timestampUtc property: Last time secret was accessed. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param timestampUtc the timestampUtc value to set. + * @return the KeyVaultLastAccessStatusContractProperties object itself. + */ + public KeyVaultLastAccessStatusContractProperties withTimestampUtc(OffsetDateTime timestampUtc) { + this.timestampUtc = timestampUtc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerCollection.java new file mode 100644 index 0000000000000..972b3afb95fbc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Logger list representation. */ +@Fluent +public final class LoggerCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggerCollection.class); + + /* + * Logger values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Logger values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Logger values. + * + * @param value the value value to set. + * @return the LoggerCollection object itself. + */ + public LoggerCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the LoggerCollection object itself. + */ + public LoggerCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the LoggerCollection object itself. + */ + public LoggerCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerContract.java new file mode 100644 index 0000000000000..86b60c2218e18 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerContract.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; +import java.util.Map; + +/** An immutable client-side representation of LoggerContract. */ +public interface LoggerContract { + /** + * 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 loggerType property: Logger type. + * + * @return the loggerType value. + */ + LoggerType loggerType(); + + /** + * Gets the description property: Logger description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the credentials property: The name and SendRule connection string of the event hub for azureEventHub logger. + * Instrumentation key for applicationInsights logger. + * + * @return the credentials value. + */ + Map credentials(); + + /** + * Gets the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to + * be true. + * + * @return the isBuffered value. + */ + Boolean isBuffered(); + + /** + * Gets the resourceId property: Azure Resource Id of a log target (either Azure Event Hub resource or Azure + * Application Insights resource). + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner object. + * + * @return the inner object. + */ + LoggerContractInner innerModel(); + + /** The entirety of the LoggerContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The LoggerContract definition stages. */ + interface DefinitionStages { + /** The first stage of the LoggerContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the LoggerContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the LoggerContract 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.WithLoggerType, + DefinitionStages.WithDescription, + DefinitionStages.WithCredentials, + DefinitionStages.WithIsBuffered, + DefinitionStages.WithResourceId, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + LoggerContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LoggerContract create(Context context); + } + /** The stage of the LoggerContract definition allowing to specify loggerType. */ + interface WithLoggerType { + /** + * Specifies the loggerType property: Logger type.. + * + * @param loggerType Logger type. + * @return the next definition stage. + */ + WithCreate withLoggerType(LoggerType loggerType); + } + /** The stage of the LoggerContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Logger description.. + * + * @param description Logger description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the LoggerContract definition allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The name and SendRule connection string of the event hub for + * azureEventHub logger. Instrumentation key for applicationInsights logger.. + * + * @param credentials The name and SendRule connection string of the event hub for azureEventHub logger. + * Instrumentation key for applicationInsights logger. + * @return the next definition stage. + */ + WithCreate withCredentials(Map credentials); + } + /** The stage of the LoggerContract definition allowing to specify isBuffered. */ + interface WithIsBuffered { + /** + * Specifies the isBuffered property: Whether records are buffered in the logger before publishing. Default + * is assumed to be true.. + * + * @param isBuffered Whether records are buffered in the logger before publishing. Default is assumed to be + * true. + * @return the next definition stage. + */ + WithCreate withIsBuffered(Boolean isBuffered); + } + /** The stage of the LoggerContract definition allowing to specify resourceId. */ + interface WithResourceId { + /** + * Specifies the resourceId property: Azure Resource Id of a log target (either Azure Event Hub resource or + * Azure Application Insights resource).. + * + * @param resourceId Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application + * Insights resource). + * @return the next definition stage. + */ + WithCreate withResourceId(String resourceId); + } + /** The stage of the LoggerContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the LoggerContract resource. + * + * @return the stage of resource update. + */ + LoggerContract.Update update(); + + /** The template for LoggerContract update. */ + interface Update + extends UpdateStages.WithLoggerType, + UpdateStages.WithDescription, + UpdateStages.WithCredentials, + UpdateStages.WithIsBuffered, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LoggerContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LoggerContract apply(Context context); + } + /** The LoggerContract update stages. */ + interface UpdateStages { + /** The stage of the LoggerContract update allowing to specify loggerType. */ + interface WithLoggerType { + /** + * Specifies the loggerType property: Logger type.. + * + * @param loggerType Logger type. + * @return the next definition stage. + */ + Update withLoggerType(LoggerType loggerType); + } + /** The stage of the LoggerContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Logger description.. + * + * @param description Logger description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the LoggerContract update allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: Logger credentials.. + * + * @param credentials Logger credentials. + * @return the next definition stage. + */ + Update withCredentials(Map credentials); + } + /** The stage of the LoggerContract update allowing to specify isBuffered. */ + interface WithIsBuffered { + /** + * Specifies the isBuffered property: Whether records are buffered in the logger before publishing. Default + * is assumed to be true.. + * + * @param isBuffered Whether records are buffered in the logger before publishing. Default is assumed to be + * true. + * @return the next definition stage. + */ + Update withIsBuffered(Boolean isBuffered); + } + /** The stage of the LoggerContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LoggerContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LoggerContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerType.java new file mode 100644 index 0000000000000..77b10f6ee626a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoggerType. */ +public final class LoggerType extends ExpandableStringEnum { + /** Static value azureEventHub for LoggerType. */ + public static final LoggerType AZURE_EVENT_HUB = fromString("azureEventHub"); + + /** Static value applicationInsights for LoggerType. */ + public static final LoggerType APPLICATION_INSIGHTS = fromString("applicationInsights"); + + /** Static value azureMonitor for LoggerType. */ + public static final LoggerType AZURE_MONITOR = fromString("azureMonitor"); + + /** + * Creates or finds a LoggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggerType. + */ + @JsonCreator + public static LoggerType fromString(String name) { + return fromString(name, LoggerType.class); + } + + /** @return known LoggerType values. */ + public static Collection values() { + return values(LoggerType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerUpdateContract.java new file mode 100644 index 0000000000000..c03bcc62f5f9a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggerUpdateContract.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Logger update contract. */ +@JsonFlatten +@Fluent +public class LoggerUpdateContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggerUpdateContract.class); + + /* + * Logger type. + */ + @JsonProperty(value = "properties.loggerType") + private LoggerType loggerType; + + /* + * Logger description. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Logger credentials. + */ + @JsonProperty(value = "properties.credentials") + private Map credentials; + + /* + * Whether records are buffered in the logger before publishing. Default is + * assumed to be true. + */ + @JsonProperty(value = "properties.isBuffered") + private Boolean isBuffered; + + /** + * Get the loggerType property: Logger type. + * + * @return the loggerType value. + */ + public LoggerType loggerType() { + return this.loggerType; + } + + /** + * Set the loggerType property: Logger type. + * + * @param loggerType the loggerType value to set. + * @return the LoggerUpdateContract object itself. + */ + public LoggerUpdateContract withLoggerType(LoggerType loggerType) { + this.loggerType = loggerType; + return this; + } + + /** + * Get the description property: Logger description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Logger description. + * + * @param description the description value to set. + * @return the LoggerUpdateContract object itself. + */ + public LoggerUpdateContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the credentials property: Logger credentials. + * + * @return the credentials value. + */ + public Map credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Logger credentials. + * + * @param credentials the credentials value to set. + * @return the LoggerUpdateContract object itself. + */ + public LoggerUpdateContract withCredentials(Map credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to + * be true. + * + * @return the isBuffered value. + */ + public Boolean isBuffered() { + return this.isBuffered; + } + + /** + * Set the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to + * be true. + * + * @param isBuffered the isBuffered value to set. + * @return the LoggerUpdateContract object itself. + */ + public LoggerUpdateContract withIsBuffered(Boolean isBuffered) { + this.isBuffered = isBuffered; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Loggers.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Loggers.java new file mode 100644 index 0000000000000..c2f66229c554a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Loggers.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Loggers. */ +public interface Loggers { + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of loggers in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| loggerType | filter | eq | |</br>| + * resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Logger list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String loggerId); + + /** + * Gets the entity state (Etag) version of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the logger specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context); + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + LoggerContract get(String resourceGroupName, String serviceName, String loggerId); + + /** + * Gets the details of the logger specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String loggerId, Context context); + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String loggerId, String ifMatch); + + /** + * Deletes the specified logger. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param loggerId Logger identifier. Must be unique in the API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String loggerId, String ifMatch, Context context); + + /** + * Gets the details of the logger specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + LoggerContract getById(String id); + + /** + * Gets the details of the logger specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the logger specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified logger. + * + * @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 the specified logger. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new LoggerContract resource. + * + * @param name resource name. + * @return the first stage of the new LoggerContract definition. + */ + LoggerContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..f9aee91ae79d1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateHeaders.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.apimanagement.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 LoggersCreateOrUpdateHeaders model. */ +@Fluent +public final class LoggersCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggersCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the LoggersCreateOrUpdateHeaders object itself. + */ + public LoggersCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..ec6e95c8b7a1f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class LoggersCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of LoggersCreateOrUpdateResponse. + * + * @param request the request which resulted in this LoggersCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public LoggersCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + LoggerContractInner value, + LoggersCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public LoggerContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagHeaders.java new file mode 100644 index 0000000000000..8fcf5b3861d2f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagHeaders.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.apimanagement.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 LoggersGetEntityTagHeaders model. */ +@Fluent +public final class LoggersGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggersGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the LoggersGetEntityTagHeaders object itself. + */ + public LoggersGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagResponse.java new file mode 100644 index 0000000000000..3b0ba16cc9c3b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class LoggersGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of LoggersGetEntityTagResponse. + * + * @param request the request which resulted in this LoggersGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public LoggersGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, LoggersGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetHeaders.java new file mode 100644 index 0000000000000..30f83f245b97f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetHeaders.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.apimanagement.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 LoggersGetHeaders model. */ +@Fluent +public final class LoggersGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggersGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the LoggersGetHeaders object itself. + */ + public LoggersGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetResponse.java new file mode 100644 index 0000000000000..b1f2e9fc605bc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; + +/** Contains all response data for the get operation. */ +public final class LoggersGetResponse extends ResponseBase { + /** + * Creates an instance of LoggersGetResponse. + * + * @param request the request which resulted in this LoggersGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public LoggersGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + LoggerContractInner value, + LoggersGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public LoggerContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateHeaders.java new file mode 100644 index 0000000000000..c50f316d70d2d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateHeaders.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.apimanagement.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 LoggersUpdateHeaders model. */ +@Fluent +public final class LoggersUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoggersUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the LoggersUpdateHeaders object itself. + */ + public LoggersUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateResponse.java new file mode 100644 index 0000000000000..83a340eb24c23 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/LoggersUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.LoggerContractInner; + +/** Contains all response data for the update operation. */ +public final class LoggersUpdateResponse extends ResponseBase { + /** + * Creates an instance of LoggersUpdateResponse. + * + * @param request the request which resulted in this LoggersUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public LoggersUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + LoggerContractInner value, + LoggersUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public LoggerContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NameAvailabilityReason.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NameAvailabilityReason.java new file mode 100644 index 0000000000000..9390fb244d216 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NameAvailabilityReason.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for NameAvailabilityReason. */ +public enum NameAvailabilityReason { + /** Enum value Valid. */ + VALID("Valid"), + + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a NameAvailabilityReason instance. */ + private final String value; + + NameAvailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameAvailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed NameAvailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static NameAvailabilityReason fromString(String value) { + NameAvailabilityReason[] items = NameAvailabilityReason.values(); + for (NameAvailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCollection.java new file mode 100644 index 0000000000000..d2b474392e0ba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged NamedValue list representation. */ +@Fluent +public final class NamedValueCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the NamedValueCollection object itself. + */ + public NamedValueCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the NamedValueCollection object itself. + */ + public NamedValueCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the NamedValueCollection object itself. + */ + public NamedValueCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContract.java new file mode 100644 index 0000000000000..b52a39f97984f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContract.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; +import java.util.List; + +/** An immutable client-side representation of NamedValueContract. */ +public interface NamedValueContract { + /** + * 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 tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @return the tags value. + */ + List tags(); + + /** + * Gets the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @return the secret value. + */ + Boolean secret(); + + /** + * Gets the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the value value. + */ + String value(); + + /** + * Gets the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + KeyVaultContractProperties keyVault(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner object. + * + * @return the inner object. + */ + NamedValueContractInner innerModel(); + + /** The entirety of the NamedValueContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NamedValueContract definition stages. */ + interface DefinitionStages { + /** The first stage of the NamedValueContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NamedValueContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the NamedValueContract 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.WithSecret, + DefinitionStages.WithDisplayName, + DefinitionStages.WithValue, + DefinitionStages.WithKeyVault, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + NamedValueContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NamedValueContract create(Context context); + } + /** The stage of the NamedValueContract definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Optional tags that when provided can be used to filter the NamedValue list.. + * + * @param tags Optional tags that when provided can be used to filter the NamedValue list. + * @return the next definition stage. + */ + WithCreate withTags(List tags); + } + /** The stage of the NamedValueContract definition allowing to specify secret. */ + interface WithSecret { + /** + * Specifies the secret property: Determines whether the value is a secret and should be encrypted or not. + * Default value is false.. + * + * @param secret Determines whether the value is a secret and should be encrypted or not. Default value is + * false. + * @return the next definition stage. + */ + WithCreate withSecret(Boolean secret); + } + /** The stage of the NamedValueContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Unique name of NamedValue. It may contain only letters, digits, + * period, dash, and underscore characters.. + * + * @param displayName Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the NamedValueContract definition allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value.. + * + * @param value Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only + * of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request + * to get the value. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + /** The stage of the NamedValueContract definition allowing to specify keyVault. */ + interface WithKeyVault { + /** + * Specifies the keyVault property: KeyVault location details of the namedValue.. + * + * @param keyVault KeyVault location details of the namedValue. + * @return the next definition stage. + */ + WithCreate withKeyVault(KeyVaultContractCreateProperties keyVault); + } + /** The stage of the NamedValueContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the NamedValueContract resource. + * + * @return the stage of resource update. + */ + NamedValueContract.Update update(); + + /** The template for NamedValueContract update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSecret, + UpdateStages.WithDisplayName, + UpdateStages.WithValue, + UpdateStages.WithKeyVault, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NamedValueContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NamedValueContract apply(Context context); + } + /** The NamedValueContract update stages. */ + interface UpdateStages { + /** The stage of the NamedValueContract update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Optional tags that when provided can be used to filter the NamedValue list.. + * + * @param tags Optional tags that when provided can be used to filter the NamedValue list. + * @return the next definition stage. + */ + Update withTags(List tags); + } + /** The stage of the NamedValueContract update allowing to specify secret. */ + interface WithSecret { + /** + * Specifies the secret property: Determines whether the value is a secret and should be encrypted or not. + * Default value is false.. + * + * @param secret Determines whether the value is a secret and should be encrypted or not. Default value is + * false. + * @return the next definition stage. + */ + Update withSecret(Boolean secret); + } + /** The stage of the NamedValueContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Unique name of NamedValue. It may contain only letters, digits, + * period, dash, and underscore characters.. + * + * @param displayName Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the NamedValueContract update allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace.. + * + * @param value Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only + * of whitespace. + * @return the next definition stage. + */ + Update withValue(String value); + } + /** The stage of the NamedValueContract update allowing to specify keyVault. */ + interface WithKeyVault { + /** + * Specifies the keyVault property: KeyVault location details of the namedValue.. + * + * @param keyVault KeyVault location details of the namedValue. + * @return the next definition stage. + */ + Update withKeyVault(KeyVaultContractCreateProperties keyVault); + } + /** The stage of the NamedValueContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NamedValueContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NamedValueContract refresh(Context context); + + /** + * Gets the secret of the named value specified by its identifier. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + NamedValueSecretContract listValue(); + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + Response listValueWithResponse(Context context); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + NamedValueContract refreshSecret(); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + NamedValueContract refreshSecret(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContractProperties.java new file mode 100644 index 0000000000000..b301874cb2c74 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueContractProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** NamedValue Contract properties. */ +@Fluent +public final class NamedValueContractProperties extends NamedValueEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueContractProperties.class); + + /* + * Unique name of NamedValue. It may contain only letters, digits, period, + * dash, and underscore characters. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. This property will not be filled on + * 'GET' operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "value") + private String value; + + /* + * KeyVault location details of the namedValue. + */ + @JsonProperty(value = "keyVault") + private KeyVaultContractProperties keyVault; + + /** + * Get the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @param displayName the displayName value to set. + * @return the NamedValueContractProperties object itself. + */ + public NamedValueContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param value the value value to set. + * @return the NamedValueContractProperties object itself. + */ + public NamedValueContractProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + public KeyVaultContractProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the namedValue. + * + * @param keyVault the keyVault value to set. + * @return the NamedValueContractProperties object itself. + */ + public NamedValueContractProperties withKeyVault(KeyVaultContractProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** {@inheritDoc} */ + @Override + public NamedValueContractProperties withTags(List tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public NamedValueContractProperties withSecret(Boolean secret) { + super.withSecret(secret); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model NamedValueContractProperties")); + } + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContract.java new file mode 100644 index 0000000000000..b9770937b3f53 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContract.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.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NamedValue details. */ +@JsonFlatten +@Fluent +public class NamedValueCreateContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueCreateContract.class); + + /* + * Optional tags that when provided can be used to filter the NamedValue + * list. + */ + @JsonProperty(value = "properties.tags") + private List tags; + + /* + * Determines whether the value is a secret and should be encrypted or not. + * Default value is false. + */ + @JsonProperty(value = "properties.secret") + private Boolean secret; + + /* + * Unique name of NamedValue. It may contain only letters, digits, period, + * dash, and underscore characters. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. This property will not be filled on + * 'GET' operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "properties.value") + private String value; + + /* + * KeyVault location details of the namedValue. + */ + @JsonProperty(value = "properties.keyVault") + private KeyVaultContractCreateProperties keyVault; + + /** + * Get the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @param tags the tags value to set. + * @return the NamedValueCreateContract object itself. + */ + public NamedValueCreateContract withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @return the secret value. + */ + public Boolean secret() { + return this.secret; + } + + /** + * Set the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @param secret the secret value to set. + * @return the NamedValueCreateContract object itself. + */ + public NamedValueCreateContract withSecret(Boolean secret) { + this.secret = secret; + return this; + } + + /** + * Get the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @param displayName the displayName value to set. + * @return the NamedValueCreateContract object itself. + */ + public NamedValueCreateContract withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param value the value value to set. + * @return the NamedValueCreateContract object itself. + */ + public NamedValueCreateContract withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + public KeyVaultContractCreateProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the namedValue. + * + * @param keyVault the keyVault value to set. + * @return the NamedValueCreateContract object itself. + */ + public NamedValueCreateContract withKeyVault(KeyVaultContractCreateProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContractProperties.java new file mode 100644 index 0000000000000..7cc0c6b7efa05 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueCreateContractProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** NamedValue Contract properties. */ +@Fluent +public final class NamedValueCreateContractProperties extends NamedValueEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueCreateContractProperties.class); + + /* + * Unique name of NamedValue. It may contain only letters, digits, period, + * dash, and underscore characters. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. This property will not be filled on + * 'GET' operations! Use '/listSecrets' POST request to get the value. + */ + @JsonProperty(value = "value") + private String value; + + /* + * KeyVault location details of the namedValue. + */ + @JsonProperty(value = "keyVault") + private KeyVaultContractCreateProperties keyVault; + + /** + * Get the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @param displayName the displayName value to set. + * @return the NamedValueCreateContractProperties object itself. + */ + public NamedValueCreateContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get + * the value. + * + * @param value the value value to set. + * @return the NamedValueCreateContractProperties object itself. + */ + public NamedValueCreateContractProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + public KeyVaultContractCreateProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the namedValue. + * + * @param keyVault the keyVault value to set. + * @return the NamedValueCreateContractProperties object itself. + */ + public NamedValueCreateContractProperties withKeyVault(KeyVaultContractCreateProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** {@inheritDoc} */ + @Override + public NamedValueCreateContractProperties withTags(List tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public NamedValueCreateContractProperties withSecret(Boolean secret) { + super.withSecret(secret); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model NamedValueCreateContractProperties")); + } + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueEntityBaseParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueEntityBaseParameters.java new file mode 100644 index 0000000000000..8d7a196803289 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueEntityBaseParameters.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.apimanagement.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; + +/** NamedValue Entity Base Parameters set. */ +@Fluent +public class NamedValueEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueEntityBaseParameters.class); + + /* + * Optional tags that when provided can be used to filter the NamedValue + * list. + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * Determines whether the value is a secret and should be encrypted or not. + * Default value is false. + */ + @JsonProperty(value = "secret") + private Boolean secret; + + /** + * Get the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @param tags the tags value to set. + * @return the NamedValueEntityBaseParameters object itself. + */ + public NamedValueEntityBaseParameters withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @return the secret value. + */ + public Boolean secret() { + return this.secret; + } + + /** + * Set the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @param secret the secret value to set. + * @return the NamedValueEntityBaseParameters object itself. + */ + public NamedValueEntityBaseParameters withSecret(Boolean secret) { + this.secret = secret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueSecretContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueSecretContract.java new file mode 100644 index 0000000000000..517e170c1dee4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueSecretContract.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner; + +/** An immutable client-side representation of NamedValueSecretContract. */ +public interface NamedValueSecretContract { + /** + * Gets the value property: This is secret value of the NamedValue entity. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner object. + * + * @return the inner object. + */ + NamedValueSecretContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameterProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameterProperties.java new file mode 100644 index 0000000000000..5277af2af58d6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameterProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** NamedValue Contract properties. */ +@Fluent +public final class NamedValueUpdateParameterProperties extends NamedValueEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueUpdateParameterProperties.class); + + /* + * Unique name of NamedValue. It may contain only letters, digits, period, + * dash, and underscore characters. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. + */ + @JsonProperty(value = "value") + private String value; + + /* + * KeyVault location details of the namedValue. + */ + @JsonProperty(value = "keyVault") + private KeyVaultContractCreateProperties keyVault; + + /** + * Get the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @param displayName the displayName value to set. + * @return the NamedValueUpdateParameterProperties object itself. + */ + public NamedValueUpdateParameterProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. + * + * @param value the value value to set. + * @return the NamedValueUpdateParameterProperties object itself. + */ + public NamedValueUpdateParameterProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + public KeyVaultContractCreateProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the namedValue. + * + * @param keyVault the keyVault value to set. + * @return the NamedValueUpdateParameterProperties object itself. + */ + public NamedValueUpdateParameterProperties withKeyVault(KeyVaultContractCreateProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** {@inheritDoc} */ + @Override + public NamedValueUpdateParameterProperties withTags(List tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public NamedValueUpdateParameterProperties withSecret(Boolean secret) { + super.withSecret(secret); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameters.java new file mode 100644 index 0000000000000..b194b3a1eb013 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValueUpdateParameters.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NamedValue update Parameters. */ +@JsonFlatten +@Fluent +public class NamedValueUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValueUpdateParameters.class); + + /* + * Optional tags that when provided can be used to filter the NamedValue + * list. + */ + @JsonProperty(value = "properties.tags") + private List tags; + + /* + * Determines whether the value is a secret and should be encrypted or not. + * Default value is false. + */ + @JsonProperty(value = "properties.secret") + private Boolean secret; + + /* + * Unique name of NamedValue. It may contain only letters, digits, period, + * dash, and underscore characters. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Value of the NamedValue. Can contain policy expressions. It may not be + * empty or consist only of whitespace. + */ + @JsonProperty(value = "properties.value") + private String value; + + /* + * KeyVault location details of the namedValue. + */ + @JsonProperty(value = "properties.keyVault") + private KeyVaultContractCreateProperties keyVault; + + /** + * Get the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Optional tags that when provided can be used to filter the NamedValue list. + * + * @param tags the tags value to set. + * @return the NamedValueUpdateParameters object itself. + */ + public NamedValueUpdateParameters withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @return the secret value. + */ + public Boolean secret() { + return this.secret; + } + + /** + * Set the secret property: Determines whether the value is a secret and should be encrypted or not. Default value + * is false. + * + * @param secret the secret value to set. + * @return the NamedValueUpdateParameters object itself. + */ + public NamedValueUpdateParameters withSecret(Boolean secret) { + this.secret = secret; + return this; + } + + /** + * Get the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Unique name of NamedValue. It may contain only letters, digits, period, dash, and + * underscore characters. + * + * @param displayName the displayName value to set. + * @return the NamedValueUpdateParameters object itself. + */ + public NamedValueUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist + * only of whitespace. + * + * @param value the value value to set. + * @return the NamedValueUpdateParameters object itself. + */ + public NamedValueUpdateParameters withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the keyVault property: KeyVault location details of the namedValue. + * + * @return the keyVault value. + */ + public KeyVaultContractCreateProperties keyVault() { + return this.keyVault; + } + + /** + * Set the keyVault property: KeyVault location details of the namedValue. + * + * @param keyVault the keyVault value to set. + * @return the NamedValueUpdateParameters object itself. + */ + public NamedValueUpdateParameters withKeyVault(KeyVaultContractCreateProperties keyVault) { + this.keyVault = keyVault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVault() != null) { + keyVault().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValues.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValues.java new file mode 100644 index 0000000000000..a19f003158be7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValues.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 NamedValues. */ +public interface NamedValues { + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of named values defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| tags | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith, any, all |</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param isKeyVaultRefreshFailed When set to true, the response contains only named value entities which failed + * refresh. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged NamedValue list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean isKeyVaultRefreshFailed, + Context context); + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Gets the entity state (Etag) version of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the named value specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + NamedValueContract get(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Gets the details of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String namedValueId, String ifMatch); + + /** + * Deletes specific named value from the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String namedValueId, String ifMatch, Context context); + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + NamedValueSecretContract listValue(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Gets the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secret of the named value specified by its identifier. + */ + Response listValueWithResponse( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + NamedValueContract refreshSecret(String resourceGroupName, String serviceName, String namedValueId); + + /** + * Refresh the secret of the named value specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param namedValueId Identifier of the NamedValue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return namedValue details. + */ + NamedValueContract refreshSecret( + String resourceGroupName, String serviceName, String namedValueId, Context context); + + /** + * Gets the details of the named value specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + NamedValueContract getById(String id); + + /** + * Gets the details of the named value specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the named value specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific named value from the API Management service instance. + * + * @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 specific named value from the API Management service instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new NamedValueContract resource. + * + * @param name resource name. + * @return the first stage of the new NamedValueContract definition. + */ + NamedValueContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..0a411b8b5c52c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateHeaders.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.apimanagement.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 NamedValuesCreateOrUpdateHeaders model. */ +@Fluent +public final class NamedValuesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NamedValuesCreateOrUpdateHeaders object itself. + */ + public NamedValuesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..b725e3286bf8f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class NamedValuesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of NamedValuesCreateOrUpdateResponse. + * + * @param request the request which resulted in this NamedValuesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NamedValuesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + NamedValueContractInner value, + NamedValuesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public NamedValueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..50e3e637d5179 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagHeaders.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.apimanagement.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 NamedValuesGetEntityTagHeaders model. */ +@Fluent +public final class NamedValuesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NamedValuesGetEntityTagHeaders object itself. + */ + public NamedValuesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagResponse.java new file mode 100644 index 0000000000000..d09cd5cd1345b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class NamedValuesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of NamedValuesGetEntityTagResponse. + * + * @param request the request which resulted in this NamedValuesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NamedValuesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + NamedValuesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetHeaders.java new file mode 100644 index 0000000000000..85a1ad9b40252 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetHeaders.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.apimanagement.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 NamedValuesGetHeaders model. */ +@Fluent +public final class NamedValuesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NamedValuesGetHeaders object itself. + */ + public NamedValuesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetResponse.java new file mode 100644 index 0000000000000..bc9f48d21d917 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; + +/** Contains all response data for the get operation. */ +public final class NamedValuesGetResponse extends ResponseBase { + /** + * Creates an instance of NamedValuesGetResponse. + * + * @param request the request which resulted in this NamedValuesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NamedValuesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + NamedValueContractInner value, + NamedValuesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public NamedValueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueHeaders.java new file mode 100644 index 0000000000000..ca1c4a8fad568 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueHeaders.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.apimanagement.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 NamedValuesListValueHeaders model. */ +@Fluent +public final class NamedValuesListValueHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesListValueHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NamedValuesListValueHeaders object itself. + */ + public NamedValuesListValueHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueResponse.java new file mode 100644 index 0000000000000..d18bc616d24b0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesListValueResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueSecretContractInner; + +/** Contains all response data for the listValue operation. */ +public final class NamedValuesListValueResponse + extends ResponseBase { + /** + * Creates an instance of NamedValuesListValueResponse. + * + * @param request the request which resulted in this NamedValuesListValueResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NamedValuesListValueResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + NamedValueSecretContractInner value, + NamedValuesListValueHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public NamedValueSecretContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretHeaders.java new file mode 100644 index 0000000000000..b3087982d990d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretHeaders.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.apimanagement.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 NamedValuesRefreshSecretHeaders model. */ +@Fluent +public final class NamedValuesRefreshSecretHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesRefreshSecretHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NamedValuesRefreshSecretHeaders object itself. + */ + public NamedValuesRefreshSecretHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretResponse.java new file mode 100644 index 0000000000000..47f1c36543e38 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesRefreshSecretResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; + +/** Contains all response data for the refreshSecret operation. */ +public final class NamedValuesRefreshSecretResponse + extends ResponseBase { + /** + * Creates an instance of NamedValuesRefreshSecretResponse. + * + * @param request the request which resulted in this NamedValuesRefreshSecretResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NamedValuesRefreshSecretResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + NamedValueContractInner value, + NamedValuesRefreshSecretHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public NamedValueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateHeaders.java new file mode 100644 index 0000000000000..7501cc4e73b52 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateHeaders.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.apimanagement.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 NamedValuesUpdateHeaders model. */ +@Fluent +public final class NamedValuesUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NamedValuesUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NamedValuesUpdateHeaders object itself. + */ + public NamedValuesUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateResponse.java new file mode 100644 index 0000000000000..b9baef3fa8976 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NamedValuesUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.NamedValueContractInner; + +/** Contains all response data for the update operation. */ +public final class NamedValuesUpdateResponse extends ResponseBase { + /** + * Creates an instance of NamedValuesUpdateResponse. + * + * @param request the request which resulted in this NamedValuesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NamedValuesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + NamedValueContractInner value, + NamedValuesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public NamedValueContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatus.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatus.java new file mode 100644 index 0000000000000..1a9d9c8ad5995 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatus.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of NetworkStatus. */ +public interface NetworkStatus { + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + List listByService(String resourceGroupName, String serviceName); + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + Response> listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + NetworkStatusContract listByLocation(String resourceGroupName, String serviceName, String locationName); + + /** + * Gets the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. This also returns the DNS Servers as visible to the CloudService. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param locationName Location in which the API Management service is deployed. This is one of the Azure Regions + * like West US, East US, South Central US. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Connectivity Status to the external resources on which the Api Management service depends from inside + * the Cloud Service. + */ + Response listByLocationWithResponse( + String resourceGroupName, String serviceName, String locationName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContract.java new file mode 100644 index 0000000000000..fadd76012907b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContract.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner; +import java.util.List; + +/** An immutable client-side representation of NetworkStatusContract. */ +public interface NetworkStatusContract { + /** + * Gets the dnsServers property: Gets the list of DNS servers IPV4 addresses. + * + * @return the dnsServers value. + */ + List dnsServers(); + + /** + * Gets the connectivityStatus property: Gets the list of Connectivity Status to the Resources on which the service + * depends upon. + * + * @return the connectivityStatus value. + */ + List connectivityStatus(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractInner object. + * + * @return the inner object. + */ + NetworkStatusContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContractByLocation.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContractByLocation.java new file mode 100644 index 0000000000000..537050263b71d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NetworkStatusContractByLocation.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractByLocationInner; + +/** An immutable client-side representation of NetworkStatusContractByLocation. */ +public interface NetworkStatusContractByLocation { + /** + * Gets the location property: Location of service. + * + * @return the location value. + */ + String location(); + + /** + * Gets the networkStatus property: Network status in Location. + * + * @return the networkStatus value. + */ + NetworkStatusContract networkStatus(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.NetworkStatusContractByLocationInner object. + * + * @return the inner object. + */ + NetworkStatusContractByLocationInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationCollection.java new file mode 100644 index 0000000000000..be69cd782d614 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Notification list representation. */ +@Fluent +public final class NotificationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NotificationCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the NotificationCollection object itself. + */ + public NotificationCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the NotificationCollection object itself. + */ + public NotificationCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the NotificationCollection object itself. + */ + public NotificationCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationContract.java new file mode 100644 index 0000000000000..9f7f04503f718 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner; + +/** An immutable client-side representation of NotificationContract. */ +public interface NotificationContract { + /** + * 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 title property: Title of the Notification. + * + * @return the title value. + */ + String title(); + + /** + * Gets the description property: Description of the Notification. + * + * @return the description value. + */ + String description(); + + /** + * Gets the recipients property: Recipient Parameter values. + * + * @return the recipients value. + */ + RecipientsContractProperties recipients(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.NotificationContractInner object. + * + * @return the inner object. + */ + NotificationContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationName.java new file mode 100644 index 0000000000000..18c2a5cccf03f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NotificationName. */ +public final class NotificationName extends ExpandableStringEnum { + /** Static value RequestPublisherNotificationMessage for NotificationName. */ + public static final NotificationName REQUEST_PUBLISHER_NOTIFICATION_MESSAGE = + fromString("RequestPublisherNotificationMessage"); + + /** Static value PurchasePublisherNotificationMessage for NotificationName. */ + public static final NotificationName PURCHASE_PUBLISHER_NOTIFICATION_MESSAGE = + fromString("PurchasePublisherNotificationMessage"); + + /** Static value NewApplicationNotificationMessage for NotificationName. */ + public static final NotificationName NEW_APPLICATION_NOTIFICATION_MESSAGE = + fromString("NewApplicationNotificationMessage"); + + /** Static value BCC for NotificationName. */ + public static final NotificationName BCC = fromString("BCC"); + + /** Static value NewIssuePublisherNotificationMessage for NotificationName. */ + public static final NotificationName NEW_ISSUE_PUBLISHER_NOTIFICATION_MESSAGE = + fromString("NewIssuePublisherNotificationMessage"); + + /** Static value AccountClosedPublisher for NotificationName. */ + public static final NotificationName ACCOUNT_CLOSED_PUBLISHER = fromString("AccountClosedPublisher"); + + /** Static value QuotaLimitApproachingPublisherNotificationMessage for NotificationName. */ + public static final NotificationName QUOTA_LIMIT_APPROACHING_PUBLISHER_NOTIFICATION_MESSAGE = + fromString("QuotaLimitApproachingPublisherNotificationMessage"); + + /** + * Creates or finds a NotificationName from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotificationName. + */ + @JsonCreator + public static NotificationName fromString(String name) { + return fromString(name, NotificationName.class); + } + + /** @return known NotificationName values. */ + public static Collection values() { + return values(NotificationName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientEmails.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientEmails.java new file mode 100644 index 0000000000000..9b03b4f002573 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientEmails.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NotificationRecipientEmails. */ +public interface NotificationRecipientEmails { + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + RecipientEmailCollection listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Gets the list of the Notification Recipient Emails subscribed to a notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient Emails subscribed to a notification. + */ + Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context); + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String email); + + /** + * Determine if Notification Recipient Email subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, String email, Context context); + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + RecipientEmailContract createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String email); + + /** + * Adds the Email address to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient Email details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, String email, Context context); + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, NotificationName notificationName, String email); + + /** + * Removes the email from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param email Email identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, String email, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientUsers.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientUsers.java new file mode 100644 index 0000000000000..1184fc1b8ebda --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/NotificationRecipientUsers.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NotificationRecipientUsers. */ +public interface NotificationRecipientUsers { + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + RecipientUserCollection listByNotification( + String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Gets the list of the Notification Recipient User subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of the Notification Recipient User subscribed to the notification. + */ + Response listByNotificationWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context); + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkEntityExists( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId); + + /** + * Determine if the Notification Recipient User is subscribed to the notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response checkEntityExistsWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context); + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + RecipientUserContract createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName, String userId); + + /** + * Adds the API Management User to the list of Recipients for the Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient User details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context); + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, NotificationName notificationName, String userId); + + /** + * Removes the API Management user from the list of Notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String userId, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Notifications.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Notifications.java new file mode 100644 index 0000000000000..c019655cfaafa --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Notifications.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.apimanagement.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 Notifications. */ +public interface Notifications { + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of properties defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Notification list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, Integer top, Integer skip, Context context); + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + NotificationContract get(String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Gets the details of the Notification specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the Notification specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, NotificationName notificationName, Context context); + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + NotificationContract createOrUpdate( + String resourceGroupName, String serviceName, NotificationName notificationName); + + /** + * Create or Update API Management publisher notification. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param notificationName Notification Name Identifier. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + NotificationName notificationName, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OAuth2AuthenticationSettingsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OAuth2AuthenticationSettingsContract.java new file mode 100644 index 0000000000000..38606e2e6d126 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OAuth2AuthenticationSettingsContract.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.apimanagement.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; + +/** API OAuth2 Authentication settings details. */ +@Fluent +public final class OAuth2AuthenticationSettingsContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OAuth2AuthenticationSettingsContract.class); + + /* + * OAuth authorization server identifier. + */ + @JsonProperty(value = "authorizationServerId") + private String authorizationServerId; + + /* + * operations scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /** + * Get the authorizationServerId property: OAuth authorization server identifier. + * + * @return the authorizationServerId value. + */ + public String authorizationServerId() { + return this.authorizationServerId; + } + + /** + * Set the authorizationServerId property: OAuth authorization server identifier. + * + * @param authorizationServerId the authorizationServerId value to set. + * @return the OAuth2AuthenticationSettingsContract object itself. + */ + public OAuth2AuthenticationSettingsContract withAuthorizationServerId(String authorizationServerId) { + this.authorizationServerId = authorizationServerId; + return this; + } + + /** + * Get the scope property: operations scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: operations scope. + * + * @param scope the scope value to set. + * @return the OAuth2AuthenticationSettingsContract object itself. + */ + public OAuth2AuthenticationSettingsContract withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdAuthenticationSettingsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdAuthenticationSettingsContract.java new file mode 100644 index 0000000000000..b5dc36d566ccb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdAuthenticationSettingsContract.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.apimanagement.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; + +/** API OAuth2 Authentication settings details. */ +@Fluent +public final class OpenIdAuthenticationSettingsContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdAuthenticationSettingsContract.class); + + /* + * OAuth authorization server identifier. + */ + @JsonProperty(value = "openidProviderId") + private String openidProviderId; + + /* + * How to send token to the server. + */ + @JsonProperty(value = "bearerTokenSendingMethods") + private List bearerTokenSendingMethods; + + /** + * Get the openidProviderId property: OAuth authorization server identifier. + * + * @return the openidProviderId value. + */ + public String openidProviderId() { + return this.openidProviderId; + } + + /** + * Set the openidProviderId property: OAuth authorization server identifier. + * + * @param openidProviderId the openidProviderId value to set. + * @return the OpenIdAuthenticationSettingsContract object itself. + */ + public OpenIdAuthenticationSettingsContract withOpenidProviderId(String openidProviderId) { + this.openidProviderId = openidProviderId; + return this; + } + + /** + * Get the bearerTokenSendingMethods property: How to send token to the server. + * + * @return the bearerTokenSendingMethods value. + */ + public List bearerTokenSendingMethods() { + return this.bearerTokenSendingMethods; + } + + /** + * Set the bearerTokenSendingMethods property: How to send token to the server. + * + * @param bearerTokenSendingMethods the bearerTokenSendingMethods value to set. + * @return the OpenIdAuthenticationSettingsContract object itself. + */ + public OpenIdAuthenticationSettingsContract withBearerTokenSendingMethods( + List bearerTokenSendingMethods) { + this.bearerTokenSendingMethods = bearerTokenSendingMethods; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviderCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviderCollection.java new file mode 100644 index 0000000000000..237bee0f5e0cc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviderCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged OpenIdProviders list representation. */ +@Fluent +public final class OpenIdConnectProviderCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProviderCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the OpenIdConnectProviderCollection object itself. + */ + public OpenIdConnectProviderCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the OpenIdConnectProviderCollection object itself. + */ + public OpenIdConnectProviderCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the OpenIdConnectProviderCollection object itself. + */ + public OpenIdConnectProviderCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviders.java new file mode 100644 index 0000000000000..a7ebcd5e9f3ae --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProviders.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.apimanagement.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 OpenIdConnectProviders. */ +public interface OpenIdConnectProviders { + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists of all the OpenId Connect Providers. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged OpenIdProviders list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String opid); + + /** + * Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the openIdConnectProvider specified by its identifier. + */ + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, String opid, Context context); + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + OpenidConnectProviderContract get(String resourceGroupName, String serviceName, String opid); + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specific OpenID Connect Provider without secrets. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String opid, Context context); + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String opid, String ifMatch); + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String opid, String ifMatch, Context context); + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + ClientSecretContract listSecrets(String resourceGroupName, String serviceName, String opid); + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param opid Identifier of the OpenID Connect Provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String opid, Context context); + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @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 specific OpenID Connect Provider without secrets. + */ + OpenidConnectProviderContract getById(String id); + + /** + * Gets specific OpenID Connect Provider without secrets. + * + * @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 specific OpenID Connect Provider without secrets. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific OpenID Connect Provider of the API Management service instance. + * + * @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 specific OpenID Connect Provider of the API Management service instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new OpenidConnectProviderContract resource. + * + * @param name resource name. + * @return the first stage of the new OpenidConnectProviderContract definition. + */ + OpenidConnectProviderContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..a7bb4d6903e11 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateHeaders.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.apimanagement.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 OpenIdConnectProvidersCreateOrUpdateHeaders model. */ +@Fluent +public final class OpenIdConnectProvidersCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the OpenIdConnectProvidersCreateOrUpdateHeaders object itself. + */ + public OpenIdConnectProvidersCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..8ba0dbf92dfff --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class OpenIdConnectProvidersCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of OpenIdConnectProvidersCreateOrUpdateResponse. + * + * @param request the request which resulted in this OpenIdConnectProvidersCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OpenIdConnectProvidersCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OpenidConnectProviderContractInner value, + OpenIdConnectProvidersCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OpenidConnectProviderContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagHeaders.java new file mode 100644 index 0000000000000..4ec164e989779 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagHeaders.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.apimanagement.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 OpenIdConnectProvidersGetEntityTagHeaders model. */ +@Fluent +public final class OpenIdConnectProvidersGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the OpenIdConnectProvidersGetEntityTagHeaders object itself. + */ + public OpenIdConnectProvidersGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagResponse.java new file mode 100644 index 0000000000000..52b65ba139f4e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetEntityTagResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class OpenIdConnectProvidersGetEntityTagResponse + extends ResponseBase { + /** + * Creates an instance of OpenIdConnectProvidersGetEntityTagResponse. + * + * @param request the request which resulted in this OpenIdConnectProvidersGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OpenIdConnectProvidersGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + OpenIdConnectProvidersGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetHeaders.java new file mode 100644 index 0000000000000..d270a052a7cbb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetHeaders.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.apimanagement.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 OpenIdConnectProvidersGetHeaders model. */ +@Fluent +public final class OpenIdConnectProvidersGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the OpenIdConnectProvidersGetHeaders object itself. + */ + public OpenIdConnectProvidersGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetResponse.java new file mode 100644 index 0000000000000..7d62a9e2ac579 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; + +/** Contains all response data for the get operation. */ +public final class OpenIdConnectProvidersGetResponse + extends ResponseBase { + /** + * Creates an instance of OpenIdConnectProvidersGetResponse. + * + * @param request the request which resulted in this OpenIdConnectProvidersGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OpenIdConnectProvidersGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OpenidConnectProviderContractInner value, + OpenIdConnectProvidersGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OpenidConnectProviderContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsHeaders.java new file mode 100644 index 0000000000000..ee3e3f3865c06 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsHeaders.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.apimanagement.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 OpenIdConnectProvidersListSecretsHeaders model. */ +@Fluent +public final class OpenIdConnectProvidersListSecretsHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersListSecretsHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the OpenIdConnectProvidersListSecretsHeaders object itself. + */ + public OpenIdConnectProvidersListSecretsHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsResponse.java new file mode 100644 index 0000000000000..ed5aaeaeb536f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersListSecretsResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ClientSecretContractInner; + +/** Contains all response data for the listSecrets operation. */ +public final class OpenIdConnectProvidersListSecretsResponse + extends ResponseBase { + /** + * Creates an instance of OpenIdConnectProvidersListSecretsResponse. + * + * @param request the request which resulted in this OpenIdConnectProvidersListSecretsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OpenIdConnectProvidersListSecretsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ClientSecretContractInner value, + OpenIdConnectProvidersListSecretsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ClientSecretContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateHeaders.java new file mode 100644 index 0000000000000..594387d1189cb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateHeaders.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.apimanagement.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 OpenIdConnectProvidersUpdateHeaders model. */ +@Fluent +public final class OpenIdConnectProvidersUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectProvidersUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the OpenIdConnectProvidersUpdateHeaders object itself. + */ + public OpenIdConnectProvidersUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateResponse.java new file mode 100644 index 0000000000000..dbdcbbe826603 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenIdConnectProvidersUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; + +/** Contains all response data for the update operation. */ +public final class OpenIdConnectProvidersUpdateResponse + extends ResponseBase { + /** + * Creates an instance of OpenIdConnectProvidersUpdateResponse. + * + * @param request the request which resulted in this OpenIdConnectProvidersUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OpenIdConnectProvidersUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OpenidConnectProviderContractInner value, + OpenIdConnectProvidersUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OpenidConnectProviderContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderContract.java new file mode 100644 index 0000000000000..37d0a2faca3d7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderContract.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; + +/** An immutable client-side representation of OpenidConnectProviderContract. */ +public interface OpenidConnectProviderContract { + /** + * 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 displayName property: User-friendly OpenID Connect Provider name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: User-friendly description of OpenID Connect Provider. + * + * @return the description value. + */ + String description(); + + /** + * Gets the metadataEndpoint property: Metadata endpoint URI. + * + * @return the metadataEndpoint value. + */ + String metadataEndpoint(); + + /** + * Gets the clientId property: Client ID of developer console which is the client application. + * + * @return the clientId value. + */ + String clientId(); + + /** + * Gets the clientSecret property: Client Secret of developer console which is the client application. + * + * @return the clientSecret value. + */ + String clientSecret(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner object. + * + * @return the inner object. + */ + OpenidConnectProviderContractInner innerModel(); + + /** The entirety of the OpenidConnectProviderContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The OpenidConnectProviderContract definition stages. */ + interface DefinitionStages { + /** The first stage of the OpenidConnectProviderContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the OpenidConnectProviderContract 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.WithDisplayName, + DefinitionStages.WithDescription, + DefinitionStages.WithMetadataEndpoint, + DefinitionStages.WithClientId, + DefinitionStages.WithClientSecret, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + OpenidConnectProviderContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OpenidConnectProviderContract create(Context context); + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: User-friendly OpenID Connect Provider name.. + * + * @param displayName User-friendly OpenID Connect Provider name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: User-friendly description of OpenID Connect Provider.. + * + * @param description User-friendly description of OpenID Connect Provider. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify metadataEndpoint. */ + interface WithMetadataEndpoint { + /** + * Specifies the metadataEndpoint property: Metadata endpoint URI.. + * + * @param metadataEndpoint Metadata endpoint URI. + * @return the next definition stage. + */ + WithCreate withMetadataEndpoint(String metadataEndpoint); + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify clientId. */ + interface WithClientId { + /** + * Specifies the clientId property: Client ID of developer console which is the client application.. + * + * @param clientId Client ID of developer console which is the client application. + * @return the next definition stage. + */ + WithCreate withClientId(String clientId); + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify clientSecret. */ + interface WithClientSecret { + /** + * Specifies the clientSecret property: Client Secret of developer console which is the client application.. + * + * @param clientSecret Client Secret of developer console which is the client application. + * @return the next definition stage. + */ + WithCreate withClientSecret(String clientSecret); + } + /** The stage of the OpenidConnectProviderContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the OpenidConnectProviderContract resource. + * + * @return the stage of resource update. + */ + OpenidConnectProviderContract.Update update(); + + /** The template for OpenidConnectProviderContract update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDescription, + UpdateStages.WithMetadataEndpoint, + UpdateStages.WithClientId, + UpdateStages.WithClientSecret, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OpenidConnectProviderContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OpenidConnectProviderContract apply(Context context); + } + /** The OpenidConnectProviderContract update stages. */ + interface UpdateStages { + /** The stage of the OpenidConnectProviderContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: User-friendly OpenID Connect Provider name.. + * + * @param displayName User-friendly OpenID Connect Provider name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the OpenidConnectProviderContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: User-friendly description of OpenID Connect Provider.. + * + * @param description User-friendly description of OpenID Connect Provider. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the OpenidConnectProviderContract update allowing to specify metadataEndpoint. */ + interface WithMetadataEndpoint { + /** + * Specifies the metadataEndpoint property: Metadata endpoint URI.. + * + * @param metadataEndpoint Metadata endpoint URI. + * @return the next definition stage. + */ + Update withMetadataEndpoint(String metadataEndpoint); + } + /** The stage of the OpenidConnectProviderContract update allowing to specify clientId. */ + interface WithClientId { + /** + * Specifies the clientId property: Client ID of developer console which is the client application.. + * + * @param clientId Client ID of developer console which is the client application. + * @return the next definition stage. + */ + Update withClientId(String clientId); + } + /** The stage of the OpenidConnectProviderContract update allowing to specify clientSecret. */ + interface WithClientSecret { + /** + * Specifies the clientSecret property: Client Secret of developer console which is the client application.. + * + * @param clientSecret Client Secret of developer console which is the client application. + * @return the next definition stage. + */ + Update withClientSecret(String clientSecret); + } + /** The stage of the OpenidConnectProviderContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OpenidConnectProviderContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OpenidConnectProviderContract refresh(Context context); + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + ClientSecretContract listSecrets(); + + /** + * Gets the client secret details of the OpenID Connect Provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the client secret details of the OpenID Connect Provider. + */ + Response listSecretsWithResponse(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderUpdateContract.java new file mode 100644 index 0000000000000..54039d34b01b6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OpenidConnectProviderUpdateContract.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Update OpenID Connect Provider operation. */ +@JsonFlatten +@Fluent +public class OpenidConnectProviderUpdateContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenidConnectProviderUpdateContract.class); + + /* + * User-friendly OpenID Connect Provider name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * User-friendly description of OpenID Connect Provider. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Metadata endpoint URI. + */ + @JsonProperty(value = "properties.metadataEndpoint") + private String metadataEndpoint; + + /* + * Client ID of developer console which is the client application. + */ + @JsonProperty(value = "properties.clientId") + private String clientId; + + /* + * Client Secret of developer console which is the client application. + */ + @JsonProperty(value = "properties.clientSecret") + private String clientSecret; + + /** + * Get the displayName property: User-friendly OpenID Connect Provider name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User-friendly OpenID Connect Provider name. + * + * @param displayName the displayName value to set. + * @return the OpenidConnectProviderUpdateContract object itself. + */ + public OpenidConnectProviderUpdateContract withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: User-friendly description of OpenID Connect Provider. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: User-friendly description of OpenID Connect Provider. + * + * @param description the description value to set. + * @return the OpenidConnectProviderUpdateContract object itself. + */ + public OpenidConnectProviderUpdateContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the metadataEndpoint property: Metadata endpoint URI. + * + * @return the metadataEndpoint value. + */ + public String metadataEndpoint() { + return this.metadataEndpoint; + } + + /** + * Set the metadataEndpoint property: Metadata endpoint URI. + * + * @param metadataEndpoint the metadataEndpoint value to set. + * @return the OpenidConnectProviderUpdateContract object itself. + */ + public OpenidConnectProviderUpdateContract withMetadataEndpoint(String metadataEndpoint) { + this.metadataEndpoint = metadataEndpoint; + return this; + } + + /** + * Get the clientId property: Client ID of developer console which is the client application. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client ID of developer console which is the client application. + * + * @param clientId the clientId value to set. + * @return the OpenidConnectProviderUpdateContract object itself. + */ + public OpenidConnectProviderUpdateContract withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client Secret of developer console which is the client application. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client Secret of developer console which is the client application. + * + * @param clientSecret the clientSecret value to set. + * @return the OpenidConnectProviderUpdateContract object itself. + */ + public OpenidConnectProviderUpdateContract withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operation.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operation.java new file mode 100644 index 0000000000000..4947e206d14fb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operation.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that describes the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The operation origin. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: The operation properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationCollection.java new file mode 100644 index 0000000000000..c38d4a303d774 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Operation list representation. */ +@Fluent +public final class OperationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the OperationCollection object itself. + */ + public OperationCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContract.java new file mode 100644 index 0000000000000..565d75693624c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContract.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner; +import java.util.List; + +/** An immutable client-side representation of OperationContract. */ +public interface OperationContract { + /** + * 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 templateParameters property: Collection of URL template parameters. + * + * @return the templateParameters value. + */ + List templateParameters(); + + /** + * Gets the description property: Description of the operation. May include HTML formatting tags. + * + * @return the description value. + */ + String description(); + + /** + * Gets the request property: An entity containing request details. + * + * @return the request value. + */ + RequestContract request(); + + /** + * Gets the responses property: Array of Operation responses. + * + * @return the responses value. + */ + List responses(); + + /** + * Gets the policies property: Operation Policies. + * + * @return the policies value. + */ + String policies(); + + /** + * Gets the displayName property: Operation Name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @return the method value. + */ + String method(); + + /** + * Gets the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @return the urlTemplate value. + */ + String urlTemplate(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.OperationContractInner object. + * + * @return the inner object. + */ + OperationContractInner innerModel(); + + /** The entirety of the OperationContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The OperationContract definition stages. */ + interface DefinitionStages { + /** The first stage of the OperationContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the OperationContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. + * Non-current revision has ;rev=n as a suffix where n is the revision number. + * @return the next definition stage. + */ + WithCreate withExistingApi(String resourceGroupName, String serviceName, String apiId); + } + /** + * The stage of the OperationContract 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.WithTemplateParameters, + DefinitionStages.WithDescription, + DefinitionStages.WithRequest, + DefinitionStages.WithResponses, + DefinitionStages.WithPolicies, + DefinitionStages.WithDisplayName, + DefinitionStages.WithMethod, + DefinitionStages.WithUrlTemplate, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + OperationContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OperationContract create(Context context); + } + /** The stage of the OperationContract definition allowing to specify templateParameters. */ + interface WithTemplateParameters { + /** + * Specifies the templateParameters property: Collection of URL template parameters.. + * + * @param templateParameters Collection of URL template parameters. + * @return the next definition stage. + */ + WithCreate withTemplateParameters(List templateParameters); + } + /** The stage of the OperationContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the operation. May include HTML formatting tags.. + * + * @param description Description of the operation. May include HTML formatting tags. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the OperationContract definition allowing to specify request. */ + interface WithRequest { + /** + * Specifies the request property: An entity containing request details.. + * + * @param request An entity containing request details. + * @return the next definition stage. + */ + WithCreate withRequest(RequestContract request); + } + /** The stage of the OperationContract definition allowing to specify responses. */ + interface WithResponses { + /** + * Specifies the responses property: Array of Operation responses.. + * + * @param responses Array of Operation responses. + * @return the next definition stage. + */ + WithCreate withResponses(List responses); + } + /** The stage of the OperationContract definition allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: Operation Policies. + * + * @param policies Operation Policies. + * @return the next definition stage. + */ + WithCreate withPolicies(String policies); + } + /** The stage of the OperationContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Operation Name.. + * + * @param displayName Operation Name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the OperationContract definition allowing to specify method. */ + interface WithMethod { + /** + * Specifies the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them.. + * + * @param method A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by + * only them. + * @return the next definition stage. + */ + WithCreate withMethod(String method); + } + /** The stage of the OperationContract definition allowing to specify urlTemplate. */ + interface WithUrlTemplate { + /** + * Specifies the urlTemplate property: Relative URL template identifying the target resource for this + * operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @param urlTemplate Relative URL template identifying the target resource for this operation. May include + * parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * @return the next definition stage. + */ + WithCreate withUrlTemplate(String urlTemplate); + } + /** The stage of the OperationContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the OperationContract resource. + * + * @return the stage of resource update. + */ + OperationContract.Update update(); + + /** The template for OperationContract update. */ + interface Update + extends UpdateStages.WithTemplateParameters, + UpdateStages.WithDescription, + UpdateStages.WithRequest, + UpdateStages.WithResponses, + UpdateStages.WithPolicies, + UpdateStages.WithDisplayName, + UpdateStages.WithMethod, + UpdateStages.WithUrlTemplate, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OperationContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OperationContract apply(Context context); + } + /** The OperationContract update stages. */ + interface UpdateStages { + /** The stage of the OperationContract update allowing to specify templateParameters. */ + interface WithTemplateParameters { + /** + * Specifies the templateParameters property: Collection of URL template parameters.. + * + * @param templateParameters Collection of URL template parameters. + * @return the next definition stage. + */ + Update withTemplateParameters(List templateParameters); + } + /** The stage of the OperationContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the operation. May include HTML formatting tags.. + * + * @param description Description of the operation. May include HTML formatting tags. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the OperationContract update allowing to specify request. */ + interface WithRequest { + /** + * Specifies the request property: An entity containing request details.. + * + * @param request An entity containing request details. + * @return the next definition stage. + */ + Update withRequest(RequestContract request); + } + /** The stage of the OperationContract update allowing to specify responses. */ + interface WithResponses { + /** + * Specifies the responses property: Array of Operation responses.. + * + * @param responses Array of Operation responses. + * @return the next definition stage. + */ + Update withResponses(List responses); + } + /** The stage of the OperationContract update allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: Operation Policies. + * + * @param policies Operation Policies. + * @return the next definition stage. + */ + Update withPolicies(String policies); + } + /** The stage of the OperationContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Operation Name.. + * + * @param displayName Operation Name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the OperationContract update allowing to specify method. */ + interface WithMethod { + /** + * Specifies the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them.. + * + * @param method A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by + * only them. + * @return the next definition stage. + */ + Update withMethod(String method); + } + /** The stage of the OperationContract update allowing to specify urlTemplate. */ + interface WithUrlTemplate { + /** + * Specifies the urlTemplate property: Relative URL template identifying the target resource for this + * operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @param urlTemplate Relative URL template identifying the target resource for this operation. May include + * parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * @return the next definition stage. + */ + Update withUrlTemplate(String urlTemplate); + } + /** The stage of the OperationContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OperationContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OperationContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContractProperties.java new file mode 100644 index 0000000000000..2451f5e090fef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationContractProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Operation Contract Properties. */ +@Fluent +public final class OperationContractProperties extends OperationEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationContractProperties.class); + + /* + * Operation Name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /* + * A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them. + */ + @JsonProperty(value = "method", required = true) + private String method; + + /* + * Relative URL template identifying the target resource for this + * operation. May include parameters. Example: + * /customers/{cid}/orders/{oid}/?date={date} + */ + @JsonProperty(value = "urlTemplate", required = true) + private String urlTemplate; + + /** + * Get the displayName property: Operation Name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Operation Name. + * + * @param displayName the displayName value to set. + * @return the OperationContractProperties object itself. + */ + public OperationContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @param method the method value to set. + * @return the OperationContractProperties object itself. + */ + public OperationContractProperties withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @return the urlTemplate value. + */ + public String urlTemplate() { + return this.urlTemplate; + } + + /** + * Set the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @param urlTemplate the urlTemplate value to set. + * @return the OperationContractProperties object itself. + */ + public OperationContractProperties withUrlTemplate(String urlTemplate) { + this.urlTemplate = urlTemplate; + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationContractProperties withTemplateParameters(List templateParameters) { + super.withTemplateParameters(templateParameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationContractProperties withRequest(RequestContract request) { + super.withRequest(request); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationContractProperties withResponses(List responses) { + super.withResponses(responses); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationContractProperties withPolicies(String policies) { + super.withPolicies(policies); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model OperationContractProperties")); + } + if (method() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property method in model OperationContractProperties")); + } + if (urlTemplate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property urlTemplate in model OperationContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationDisplay.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationDisplay.java new file mode 100644 index 0000000000000..046e0b6e47237 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 object that describes the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Friendly name of the resource provider + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Operation type: read, write, delete, listKeys/action, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Friendly name of the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Friendly name of the resource provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Friendly name of the resource provider. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the operation property: Operation type: read, write, delete, listKeys/action, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: read, write, delete, listKeys/action, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource property: Resource type on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource type on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description property: Friendly name of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Friendly name of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationEntityBaseContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationEntityBaseContract.java new file mode 100644 index 0000000000000..b1ff6507b87c2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationEntityBaseContract.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Api Operation Entity Base Contract details. */ +@Fluent +public class OperationEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationEntityBaseContract.class); + + /* + * Collection of URL template parameters. + */ + @JsonProperty(value = "templateParameters") + private List templateParameters; + + /* + * Description of the operation. May include HTML formatting tags. + */ + @JsonProperty(value = "description") + private String description; + + /* + * An entity containing request details. + */ + @JsonProperty(value = "request") + private RequestContract request; + + /* + * Array of Operation responses. + */ + @JsonProperty(value = "responses") + private List responses; + + /* + * Operation Policies + */ + @JsonProperty(value = "policies") + private String policies; + + /** + * Get the templateParameters property: Collection of URL template parameters. + * + * @return the templateParameters value. + */ + public List templateParameters() { + return this.templateParameters; + } + + /** + * Set the templateParameters property: Collection of URL template parameters. + * + * @param templateParameters the templateParameters value to set. + * @return the OperationEntityBaseContract object itself. + */ + public OperationEntityBaseContract withTemplateParameters(List templateParameters) { + this.templateParameters = templateParameters; + return this; + } + + /** + * Get the description property: Description of the operation. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the OperationEntityBaseContract object itself. + */ + public OperationEntityBaseContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the request property: An entity containing request details. + * + * @return the request value. + */ + public RequestContract request() { + return this.request; + } + + /** + * Set the request property: An entity containing request details. + * + * @param request the request value to set. + * @return the OperationEntityBaseContract object itself. + */ + public OperationEntityBaseContract withRequest(RequestContract request) { + this.request = request; + return this; + } + + /** + * Get the responses property: Array of Operation responses. + * + * @return the responses value. + */ + public List responses() { + return this.responses; + } + + /** + * Set the responses property: Array of Operation responses. + * + * @param responses the responses value to set. + * @return the OperationEntityBaseContract object itself. + */ + public OperationEntityBaseContract withResponses(List responses) { + this.responses = responses; + return this; + } + + /** + * Get the policies property: Operation Policies. + * + * @return the policies value. + */ + public String policies() { + return this.policies; + } + + /** + * Set the policies property: Operation Policies. + * + * @param policies the policies value to set. + * @return the OperationEntityBaseContract object itself. + */ + public OperationEntityBaseContract withPolicies(String policies) { + this.policies = policies; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateParameters() != null) { + templateParameters().forEach(e -> e.validate()); + } + if (request() != null) { + request().validate(); + } + if (responses() != null) { + responses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationListResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationListResult.java new file mode 100644 index 0000000000000..dcc16439bf6fc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the + * next set of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of operations supported by the resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of operations supported by the resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationNameFormat.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationNameFormat.java new file mode 100644 index 0000000000000..f6b3153518237 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationNameFormat.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationNameFormat. */ +public final class OperationNameFormat extends ExpandableStringEnum { + /** Static value Name for OperationNameFormat. */ + public static final OperationNameFormat NAME = fromString("Name"); + + /** Static value Url for OperationNameFormat. */ + public static final OperationNameFormat URL = fromString("Url"); + + /** + * Creates or finds a OperationNameFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationNameFormat. + */ + @JsonCreator + public static OperationNameFormat fromString(String name) { + return fromString(name, OperationNameFormat.class); + } + + /** @return known OperationNameFormat values. */ + public static Collection values() { + return values(OperationNameFormat.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultContract.java new file mode 100644 index 0000000000000..96c808a7a4213 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.OperationResultContractInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of OperationResultContract. */ +public interface OperationResultContract { + /** + * Gets the id property: Operation result identifier. + * + * @return the id value. + */ + String id(); + + /** + * Gets the status property: Status of an async operation. + * + * @return the status value. + */ + AsyncOperationStatus status(); + + /** + * Gets the started property: Start time of an async operation. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the started value. + */ + OffsetDateTime started(); + + /** + * Gets the updated property: Last update time of an async operation. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the updated value. + */ + OffsetDateTime updated(); + + /** + * Gets the resultInfo property: Optional result info. + * + * @return the resultInfo value. + */ + String resultInfo(); + + /** + * Gets the error property: Error Body Contract. + * + * @return the error value. + */ + ErrorResponseBody error(); + + /** + * Gets the actionLog property: This property if only provided as part of the TenantConfiguration_Validate + * operation. It contains the log the entities which will be updated/created/deleted as part of the + * TenantConfiguration_Deploy operation. + * + * @return the actionLog value. + */ + List actionLog(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.OperationResultContractInner object. + * + * @return the inner object. + */ + OperationResultContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultLogItemContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultLogItemContract.java new file mode 100644 index 0000000000000..4ca2931e96709 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationResultLogItemContract.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.apimanagement.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; + +/** Log of the entity being created, updated or deleted. */ +@Fluent +public final class OperationResultLogItemContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultLogItemContract.class); + + /* + * The type of entity contract. + */ + @JsonProperty(value = "objectType") + private String objectType; + + /* + * Action like create/update/delete. + */ + @JsonProperty(value = "action") + private String action; + + /* + * Identifier of the entity being created/updated/deleted. + */ + @JsonProperty(value = "objectKey") + private String objectKey; + + /** + * Get the objectType property: The type of entity contract. + * + * @return the objectType value. + */ + public String objectType() { + return this.objectType; + } + + /** + * Set the objectType property: The type of entity contract. + * + * @param objectType the objectType value to set. + * @return the OperationResultLogItemContract object itself. + */ + public OperationResultLogItemContract withObjectType(String objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the action property: Action like create/update/delete. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: Action like create/update/delete. + * + * @param action the action value to set. + * @return the OperationResultLogItemContract object itself. + */ + public OperationResultLogItemContract withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the objectKey property: Identifier of the entity being created/updated/deleted. + * + * @return the objectKey value. + */ + public String objectKey() { + return this.objectKey; + } + + /** + * Set the objectKey property: Identifier of the entity being created/updated/deleted. + * + * @param objectKey the objectKey value to set. + * @return the OperationResultLogItemContract object itself. + */ + public OperationResultLogItemContract withObjectKey(String objectKey) { + this.objectKey = objectKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationTagResourceContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationTagResourceContractProperties.java new file mode 100644 index 0000000000000..c53be7d0f950f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationTagResourceContractProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Operation Entity contract Properties. */ +@Fluent +public final class OperationTagResourceContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationTagResourceContractProperties.class); + + /* + * Identifier of the operation in form /operations/{operationId}. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Operation name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Api Name. + */ + @JsonProperty(value = "apiName", access = JsonProperty.Access.WRITE_ONLY) + private String apiName; + + /* + * Api Revision. + */ + @JsonProperty(value = "apiRevision", access = JsonProperty.Access.WRITE_ONLY) + private String apiRevision; + + /* + * Api Version. + */ + @JsonProperty(value = "apiVersion", access = JsonProperty.Access.WRITE_ONLY) + private String apiVersion; + + /* + * Operation Description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them. + */ + @JsonProperty(value = "method", access = JsonProperty.Access.WRITE_ONLY) + private String method; + + /* + * Relative URL template identifying the target resource for this + * operation. May include parameters. Example: + * /customers/{cid}/orders/{oid}/?date={date} + */ + @JsonProperty(value = "urlTemplate", access = JsonProperty.Access.WRITE_ONLY) + private String urlTemplate; + + /** + * Get the id property: Identifier of the operation in form /operations/{operationId}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Identifier of the operation in form /operations/{operationId}. + * + * @param id the id value to set. + * @return the OperationTagResourceContractProperties object itself. + */ + public OperationTagResourceContractProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the apiName property: Api Name. + * + * @return the apiName value. + */ + public String apiName() { + return this.apiName; + } + + /** + * Get the apiRevision property: Api Revision. + * + * @return the apiRevision value. + */ + public String apiRevision() { + return this.apiRevision; + } + + /** + * Get the apiVersion property: Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Get the description property: Operation Description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Get the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @return the urlTemplate value. + */ + public String urlTemplate() { + return this.urlTemplate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContract.java new file mode 100644 index 0000000000000..537a239f2a7df --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContract.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Api Operation Update Contract details. */ +@JsonFlatten +@Fluent +public class OperationUpdateContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationUpdateContract.class); + + /* + * Collection of URL template parameters. + */ + @JsonProperty(value = "properties.templateParameters") + private List templateParameters; + + /* + * Description of the operation. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * An entity containing request details. + */ + @JsonProperty(value = "properties.request") + private RequestContract request; + + /* + * Array of Operation responses. + */ + @JsonProperty(value = "properties.responses") + private List responses; + + /* + * Operation Policies + */ + @JsonProperty(value = "properties.policies") + private String policies; + + /* + * Operation Name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them. + */ + @JsonProperty(value = "properties.method") + private String method; + + /* + * Relative URL template identifying the target resource for this + * operation. May include parameters. Example: + * /customers/{cid}/orders/{oid}/?date={date} + */ + @JsonProperty(value = "properties.urlTemplate") + private String urlTemplate; + + /** + * Get the templateParameters property: Collection of URL template parameters. + * + * @return the templateParameters value. + */ + public List templateParameters() { + return this.templateParameters; + } + + /** + * Set the templateParameters property: Collection of URL template parameters. + * + * @param templateParameters the templateParameters value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withTemplateParameters(List templateParameters) { + this.templateParameters = templateParameters; + return this; + } + + /** + * Get the description property: Description of the operation. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the request property: An entity containing request details. + * + * @return the request value. + */ + public RequestContract request() { + return this.request; + } + + /** + * Set the request property: An entity containing request details. + * + * @param request the request value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withRequest(RequestContract request) { + this.request = request; + return this; + } + + /** + * Get the responses property: Array of Operation responses. + * + * @return the responses value. + */ + public List responses() { + return this.responses; + } + + /** + * Set the responses property: Array of Operation responses. + * + * @param responses the responses value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withResponses(List responses) { + this.responses = responses; + return this; + } + + /** + * Get the policies property: Operation Policies. + * + * @return the policies value. + */ + public String policies() { + return this.policies; + } + + /** + * Set the policies property: Operation Policies. + * + * @param policies the policies value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withPolicies(String policies) { + this.policies = policies; + return this; + } + + /** + * Get the displayName property: Operation Name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Operation Name. + * + * @param displayName the displayName value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @param method the method value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @return the urlTemplate value. + */ + public String urlTemplate() { + return this.urlTemplate; + } + + /** + * Set the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @param urlTemplate the urlTemplate value to set. + * @return the OperationUpdateContract object itself. + */ + public OperationUpdateContract withUrlTemplate(String urlTemplate) { + this.urlTemplate = urlTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateParameters() != null) { + templateParameters().forEach(e -> e.validate()); + } + if (request() != null) { + request().validate(); + } + if (responses() != null) { + responses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContractProperties.java new file mode 100644 index 0000000000000..c345029ff9826 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/OperationUpdateContractProperties.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.apimanagement.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; + +/** Operation Update Contract Properties. */ +@Fluent +public final class OperationUpdateContractProperties extends OperationEntityBaseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationUpdateContractProperties.class); + + /* + * Operation Name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST + * but not limited by only them. + */ + @JsonProperty(value = "method") + private String method; + + /* + * Relative URL template identifying the target resource for this + * operation. May include parameters. Example: + * /customers/{cid}/orders/{oid}/?date={date} + */ + @JsonProperty(value = "urlTemplate") + private String urlTemplate; + + /** + * Get the displayName property: Operation Name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Operation Name. + * + * @param displayName the displayName value to set. + * @return the OperationUpdateContractProperties object itself. + */ + public OperationUpdateContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited + * by only them. + * + * @param method the method value to set. + * @return the OperationUpdateContractProperties object itself. + */ + public OperationUpdateContractProperties withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @return the urlTemplate value. + */ + public String urlTemplate() { + return this.urlTemplate; + } + + /** + * Set the urlTemplate property: Relative URL template identifying the target resource for this operation. May + * include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}. + * + * @param urlTemplate the urlTemplate value to set. + * @return the OperationUpdateContractProperties object itself. + */ + public OperationUpdateContractProperties withUrlTemplate(String urlTemplate) { + this.urlTemplate = urlTemplate; + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationUpdateContractProperties withTemplateParameters(List templateParameters) { + super.withTemplateParameters(templateParameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationUpdateContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationUpdateContractProperties withRequest(RequestContract request) { + super.withRequest(request); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationUpdateContractProperties withResponses(List responses) { + super.withResponses(responses); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationUpdateContractProperties withPolicies(String policies) { + super.withPolicies(policies); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operations.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operations.java new file mode 100644 index 0000000000000..8b7309284c9af --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Operations.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByTags(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists a collection of operations associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedOperations Include not tagged Operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedOperations, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ParameterContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ParameterContract.java new file mode 100644 index 0000000000000..e65ecd940f8ba --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ParameterContract.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Operation parameters details. */ +@Fluent +public final class ParameterContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ParameterContract.class); + + /* + * Parameter name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Parameter description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Parameter type. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Default parameter value. + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /* + * Specifies whether parameter is required or not. + */ + @JsonProperty(value = "required") + private Boolean required; + + /* + * Parameter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the name property: Parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Parameter name. + * + * @param name the name value to set. + * @return the ParameterContract object itself. + */ + public ParameterContract withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Parameter description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Parameter description. + * + * @param description the description value to set. + * @return the ParameterContract object itself. + */ + public ParameterContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type property: Parameter type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Parameter type. + * + * @param type the type value to set. + * @return the ParameterContract object itself. + */ + public ParameterContract withType(String type) { + this.type = type; + return this; + } + + /** + * Get the defaultValue property: Default parameter value. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue property: Default parameter value. + * + * @param defaultValue the defaultValue value to set. + * @return the ParameterContract object itself. + */ + public ParameterContract withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get the required property: Specifies whether parameter is required or not. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Set the required property: Specifies whether parameter is required or not. + * + * @param required the required value to set. + * @return the ParameterContract object itself. + */ + public ParameterContract withRequired(Boolean required) { + this.required = required; + return this; + } + + /** + * Get the values property: Parameter values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Parameter values. + * + * @param values the values value to set. + * @return the ParameterContract object itself. + */ + public ParameterContract withValues(List values) { + this.values = values; + 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 ParameterContract")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ParameterContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PipelineDiagnosticSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PipelineDiagnosticSettings.java new file mode 100644 index 0000000000000..7b058f72d7cb9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PipelineDiagnosticSettings.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.apimanagement.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; + +/** Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. */ +@Fluent +public final class PipelineDiagnosticSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PipelineDiagnosticSettings.class); + + /* + * Diagnostic settings for request. + */ + @JsonProperty(value = "request") + private HttpMessageDiagnostic request; + + /* + * Diagnostic settings for response. + */ + @JsonProperty(value = "response") + private HttpMessageDiagnostic response; + + /** + * Get the request property: Diagnostic settings for request. + * + * @return the request value. + */ + public HttpMessageDiagnostic request() { + return this.request; + } + + /** + * Set the request property: Diagnostic settings for request. + * + * @param request the request value to set. + * @return the PipelineDiagnosticSettings object itself. + */ + public PipelineDiagnosticSettings withRequest(HttpMessageDiagnostic request) { + this.request = request; + return this; + } + + /** + * Get the response property: Diagnostic settings for response. + * + * @return the response value. + */ + public HttpMessageDiagnostic response() { + return this.response; + } + + /** + * Set the response property: Diagnostic settings for response. + * + * @param response the response value to set. + * @return the PipelineDiagnosticSettings object itself. + */ + public PipelineDiagnosticSettings withResponse(HttpMessageDiagnostic response) { + this.response = response; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (request() != null) { + request().validate(); + } + if (response() != null) { + response().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Policies.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Policies.java new file mode 100644 index 0000000000000..52cccc6d160f6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Policies.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Resource collection API of Policies. */ +public interface Policies { + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + PolicyCollection listByService(String resourceGroupName, String serviceName); + + /** + * Lists all the Global Policy definitions of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the list policy operation. + */ + Response listByServiceWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, PolicyIdName policyId); + + /** + * Gets the entity state (Etag) version of the Global policy definition in the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 entity state (Etag) version of the Global policy definition in the Api Management service. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, Context context); + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the 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 Global policy definition of the Api Management service. + */ + PolicyContract get(String resourceGroupName, String serviceName, PolicyIdName policyId); + + /** + * Get the Global policy definition of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Global policy definition of the Api Management service. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + PolicyContract createOrUpdate( + String resourceGroupName, String serviceName, PolicyIdName policyId, PolicyContractInner parameters); + + /** + * Creates or updates the global policy configuration of the Api Management service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, PolicyIdName policyId, String ifMatch); + + /** + * Deletes the global policy configuration of the Api Management Service. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, PolicyIdName policyId, String ifMatch, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..0d528aab7f98f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateHeaders.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.apimanagement.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 PoliciesCreateOrUpdateHeaders model. */ +@Fluent +public final class PoliciesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoliciesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PoliciesCreateOrUpdateHeaders object itself. + */ + public PoliciesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..af45021963a49 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class PoliciesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of PoliciesCreateOrUpdateResponse. + * + * @param request the request which resulted in this PoliciesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PoliciesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + PoliciesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..4908b3f9caf6a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagHeaders.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.apimanagement.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 PoliciesGetEntityTagHeaders model. */ +@Fluent +public final class PoliciesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoliciesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PoliciesGetEntityTagHeaders object itself. + */ + public PoliciesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagResponse.java new file mode 100644 index 0000000000000..e8ba34acaf1cb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class PoliciesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of PoliciesGetEntityTagResponse. + * + * @param request the request which resulted in this PoliciesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PoliciesGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, PoliciesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetHeaders.java new file mode 100644 index 0000000000000..5da8e4c95beb8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetHeaders.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.apimanagement.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 PoliciesGetHeaders model. */ +@Fluent +public final class PoliciesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PoliciesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PoliciesGetHeaders object itself. + */ + public PoliciesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetResponse.java new file mode 100644 index 0000000000000..feea13c10d249 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PoliciesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the get operation. */ +public final class PoliciesGetResponse extends ResponseBase { + /** + * Creates an instance of PoliciesGetResponse. + * + * @param request the request which resulted in this PoliciesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PoliciesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + PoliciesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyCollection.java new file mode 100644 index 0000000000000..622086179e0b1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyCollection.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner; +import java.util.List; + +/** An immutable client-side representation of PolicyCollection. */ +public interface PolicyCollection { + /** + * Gets the value property: Policy Contract value. + * + * @return the value value. + */ + List value(); + + /** + * Gets the count property: Total record count number. + * + * @return the count value. + */ + Long count(); + + /** + * Gets the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PolicyCollectionInner object. + * + * @return the inner object. + */ + PolicyCollectionInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContentFormat.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContentFormat.java new file mode 100644 index 0000000000000..533111bd84b03 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContentFormat.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyContentFormat. */ +public final class PolicyContentFormat extends ExpandableStringEnum { + /** Static value xml for PolicyContentFormat. */ + public static final PolicyContentFormat XML = fromString("xml"); + + /** Static value xml-link for PolicyContentFormat. */ + public static final PolicyContentFormat XML_LINK = fromString("xml-link"); + + /** Static value rawxml for PolicyContentFormat. */ + public static final PolicyContentFormat RAWXML = fromString("rawxml"); + + /** Static value rawxml-link for PolicyContentFormat. */ + public static final PolicyContentFormat RAWXML_LINK = fromString("rawxml-link"); + + /** + * Creates or finds a PolicyContentFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyContentFormat. + */ + @JsonCreator + public static PolicyContentFormat fromString(String name) { + return fromString(name, PolicyContentFormat.class); + } + + /** @return known PolicyContentFormat values. */ + public static Collection values() { + return values(PolicyContentFormat.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContract.java new file mode 100644 index 0000000000000..7da451a51a8c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyContract.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** An immutable client-side representation of PolicyContract. */ +public interface PolicyContract { + /** + * 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 value property: Contents of the Policy as defined by the format. + * + * @return the value value. + */ + String value(); + + /** + * Gets the format property: Format of the policyContent. + * + * @return the format value. + */ + PolicyContentFormat format(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner object. + * + * @return the inner object. + */ + PolicyContractInner innerModel(); + + /** The entirety of the PolicyContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PolicyContract definition stages. */ + interface DefinitionStages { + /** The first stage of the PolicyContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PolicyContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId, operationId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. + * Non-current revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management + * service instance. + * @return the next definition stage. + */ + WithCreate withExistingOperation( + String resourceGroupName, String serviceName, String apiId, String operationId); + } + /** + * The stage of the PolicyContract 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.WithValue, DefinitionStages.WithFormat, DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + PolicyContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PolicyContract create(Context context); + } + /** The stage of the PolicyContract definition allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Contents of the Policy as defined by the format.. + * + * @param value Contents of the Policy as defined by the format. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + /** The stage of the PolicyContract definition allowing to specify format. */ + interface WithFormat { + /** + * Specifies the format property: Format of the policyContent.. + * + * @param format Format of the policyContent. + * @return the next definition stage. + */ + WithCreate withFormat(PolicyContentFormat format); + } + /** The stage of the PolicyContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the PolicyContract resource. + * + * @return the stage of resource update. + */ + PolicyContract.Update update(); + + /** The template for PolicyContract update. */ + interface Update extends UpdateStages.WithValue, UpdateStages.WithFormat, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PolicyContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PolicyContract apply(Context context); + } + /** The PolicyContract update stages. */ + interface UpdateStages { + /** The stage of the PolicyContract update allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Contents of the Policy as defined by the format.. + * + * @param value Contents of the Policy as defined by the format. + * @return the next definition stage. + */ + Update withValue(String value); + } + /** The stage of the PolicyContract update allowing to specify format. */ + interface WithFormat { + /** + * Specifies the format property: Format of the policyContent.. + * + * @param format Format of the policyContent. + * @return the next definition stage. + */ + Update withFormat(PolicyContentFormat format); + } + /** The stage of the PolicyContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PolicyContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PolicyContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionCollection.java new file mode 100644 index 0000000000000..ed05b24c6bf2b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionCollection.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyDescriptionCollectionInner; +import java.util.List; + +/** An immutable client-side representation of PolicyDescriptionCollection. */ +public interface PolicyDescriptionCollection { + /** + * Gets the value property: Descriptions of APIM policies. + * + * @return the value value. + */ + List value(); + + /** + * Gets the count property: Total record count number. + * + * @return the count value. + */ + Long count(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PolicyDescriptionCollectionInner object. + * + * @return the inner object. + */ + PolicyDescriptionCollectionInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionContract.java new file mode 100644 index 0000000000000..0883ac1ad709b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptionContract.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Policy description details. */ +@JsonFlatten +@Immutable +public class PolicyDescriptionContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PolicyDescriptionContract.class); + + /* + * Policy description. + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Binary OR value of the Snippet scope. + */ + @JsonProperty(value = "properties.scope", access = JsonProperty.Access.WRITE_ONLY) + private Long scope; + + /** + * Get the description property: Policy description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the scope property: Binary OR value of the Snippet scope. + * + * @return the scope value. + */ + public Long scope() { + return this.scope; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptions.java new file mode 100644 index 0000000000000..67dfd53967977 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyDescriptions.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PolicyDescriptions. */ +public interface PolicyDescriptions { + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + PolicyDescriptionCollection listByService(String resourceGroupName, String serviceName); + + /** + * Lists all policy descriptions. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param scope Policy scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, PolicyScopeContract scope, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyExportFormat.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyExportFormat.java new file mode 100644 index 0000000000000..23d9fa0e25e43 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyExportFormat.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyExportFormat. */ +public final class PolicyExportFormat extends ExpandableStringEnum { + /** Static value xml for PolicyExportFormat. */ + public static final PolicyExportFormat XML = fromString("xml"); + + /** Static value rawxml for PolicyExportFormat. */ + public static final PolicyExportFormat RAWXML = fromString("rawxml"); + + /** + * Creates or finds a PolicyExportFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyExportFormat. + */ + @JsonCreator + public static PolicyExportFormat fromString(String name) { + return fromString(name, PolicyExportFormat.class); + } + + /** @return known PolicyExportFormat values. */ + public static Collection values() { + return values(PolicyExportFormat.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyIdName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyIdName.java new file mode 100644 index 0000000000000..e215f3a8667a6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyIdName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyIdName. */ +public final class PolicyIdName extends ExpandableStringEnum { + /** Static value policy for PolicyIdName. */ + public static final PolicyIdName POLICY = fromString("policy"); + + /** + * Creates or finds a PolicyIdName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyIdName. + */ + @JsonCreator + public static PolicyIdName fromString(String name) { + return fromString(name, PolicyIdName.class); + } + + /** @return known PolicyIdName values. */ + public static Collection values() { + return values(PolicyIdName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyScopeContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyScopeContract.java new file mode 100644 index 0000000000000..c5193c2e8eedb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PolicyScopeContract.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for PolicyScopeContract. */ +public enum PolicyScopeContract { + /** Enum value Tenant. */ + TENANT("Tenant"), + + /** Enum value Product. */ + PRODUCT("Product"), + + /** Enum value Api. */ + API("Api"), + + /** Enum value Operation. */ + OPERATION("Operation"), + + /** Enum value All. */ + ALL("All"); + + /** The actual serialized value for a PolicyScopeContract instance. */ + private final String value; + + PolicyScopeContract(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PolicyScopeContract instance. + * + * @param value the serialized value to parse. + * @return the parsed PolicyScopeContract object, or null if unable to parse. + */ + @JsonCreator + public static PolicyScopeContract fromString(String value) { + PolicyScopeContract[] items = PolicyScopeContract.values(); + for (PolicyScopeContract item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalDelegationSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalDelegationSettings.java new file mode 100644 index 0000000000000..eee7a01e89195 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalDelegationSettings.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner; + +/** An immutable client-side representation of PortalDelegationSettings. */ +public interface PortalDelegationSettings { + /** + * 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 url property: A delegation Url. + * + * @return the url value. + */ + String url(); + + /** + * Gets the validationKey property: A base64-encoded validation key to validate, that a request is coming from Azure + * API Management. + * + * @return the validationKey value. + */ + String validationKey(); + + /** + * Gets the subscriptions property: Subscriptions delegation settings. + * + * @return the subscriptions value. + */ + SubscriptionsDelegationSettingsProperties subscriptions(); + + /** + * Gets the userRegistration property: User registration delegation settings. + * + * @return the userRegistration value. + */ + RegistrationDelegationSettingsProperties userRegistration(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PortalDelegationSettingsInner object. + * + * @return the inner object. + */ + PortalDelegationSettingsInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionCollection.java new file mode 100644 index 0000000000000..4e9528fa3242e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged list of portal revisions. */ +@Immutable +public final class PortalRevisionCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionCollection.class); + + /* + * Collection of portal revisions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link, if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of portal revisions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionContract.java new file mode 100644 index 0000000000000..982d01b477c87 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionContract.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of PortalRevisionContract. */ +public interface PortalRevisionContract { + /** + * 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 description property: Portal revision description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the statusDetails property: Portal revision publishing status details. + * + * @return the statusDetails value. + */ + String statusDetails(); + + /** + * Gets the status property: Portal revision publishing status. + * + * @return the status value. + */ + PortalRevisionStatus status(); + + /** + * Gets the isCurrent property: Indicates if the Portal Revision is public. + * + * @return the isCurrent value. + */ + Boolean isCurrent(); + + /** + * Gets the createdDateTime property: Portal revision creation date and time. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the updatedDateTime property: Last updated date and time. + * + * @return the updatedDateTime value. + */ + OffsetDateTime updatedDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner object. + * + * @return the inner object. + */ + PortalRevisionContractInner innerModel(); + + /** The entirety of the PortalRevisionContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PortalRevisionContract definition stages. */ + interface DefinitionStages { + /** The first stage of the PortalRevisionContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PortalRevisionContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the PortalRevisionContract 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.WithDescription, DefinitionStages.WithIsCurrent { + /** + * Executes the create request. + * + * @return the created resource. + */ + PortalRevisionContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PortalRevisionContract create(Context context); + } + /** The stage of the PortalRevisionContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Portal revision description.. + * + * @param description Portal revision description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the PortalRevisionContract definition allowing to specify isCurrent. */ + interface WithIsCurrent { + /** + * Specifies the isCurrent property: Indicates if the Portal Revision is public.. + * + * @param isCurrent Indicates if the Portal Revision is public. + * @return the next definition stage. + */ + WithCreate withIsCurrent(Boolean isCurrent); + } + } + /** + * Begins update for the PortalRevisionContract resource. + * + * @return the stage of resource update. + */ + PortalRevisionContract.Update update(); + + /** The template for PortalRevisionContract update. */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithIsCurrent, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PortalRevisionContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PortalRevisionContract apply(Context context); + } + /** The PortalRevisionContract update stages. */ + interface UpdateStages { + /** The stage of the PortalRevisionContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Portal revision description.. + * + * @param description Portal revision description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the PortalRevisionContract update allowing to specify isCurrent. */ + interface WithIsCurrent { + /** + * Specifies the isCurrent property: Indicates if the Portal Revision is public.. + * + * @param isCurrent Indicates if the Portal Revision is public. + * @return the next definition stage. + */ + Update withIsCurrent(Boolean isCurrent); + } + /** The stage of the PortalRevisionContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PortalRevisionContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PortalRevisionContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionStatus.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionStatus.java new file mode 100644 index 0000000000000..48aeda491ed11 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionStatus.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PortalRevisionStatus. */ +public final class PortalRevisionStatus extends ExpandableStringEnum { + /** Static value pending for PortalRevisionStatus. */ + public static final PortalRevisionStatus PENDING = fromString("pending"); + + /** Static value publishing for PortalRevisionStatus. */ + public static final PortalRevisionStatus PUBLISHING = fromString("publishing"); + + /** Static value completed for PortalRevisionStatus. */ + public static final PortalRevisionStatus COMPLETED = fromString("completed"); + + /** Static value failed for PortalRevisionStatus. */ + public static final PortalRevisionStatus FAILED = fromString("failed"); + + /** + * Creates or finds a PortalRevisionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PortalRevisionStatus. + */ + @JsonCreator + public static PortalRevisionStatus fromString(String name) { + return fromString(name, PortalRevisionStatus.class); + } + + /** @return known PortalRevisionStatus values. */ + public static Collection values() { + return values(PortalRevisionStatus.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisions.java new file mode 100644 index 0000000000000..7b91e9896ef87 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisions.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 PortalRevisions. */ +public interface PortalRevisions { + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of developer portal revision entities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Supported operators | Supported functions | + * |-------------|------------------------|-----------------------------------| + *

|name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith| |isCurrent | eq, ne | |. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged list of portal revisions. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String portalRevisionId); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + PortalRevisionContract get(String resourceGroupName, String serviceName, String portalRevisionId); + + /** + * Gets developer portal revision specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param portalRevisionId Portal revision identifier. Must be unique in the current API Management service + * instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return developer portal revision specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String portalRevisionId, Context context); + + /** + * Gets developer portal revision specified by its identifier. + * + * @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 developer portal revision specified by its identifier. + */ + PortalRevisionContract getById(String id); + + /** + * Gets developer portal revision specified by its identifier. + * + * @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 developer portal revision specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PortalRevisionContract resource. + * + * @param name resource name. + * @return the first stage of the new PortalRevisionContract definition. + */ + PortalRevisionContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..97c021da487a9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateHeaders.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.apimanagement.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 PortalRevisionsCreateOrUpdateHeaders model. */ +@Fluent +public final class PortalRevisionsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PortalRevisionsCreateOrUpdateHeaders object itself. + */ + public PortalRevisionsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..e4b702b12970f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class PortalRevisionsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of PortalRevisionsCreateOrUpdateResponse. + * + * @param request the request which resulted in this PortalRevisionsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PortalRevisionsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PortalRevisionContractInner value, + PortalRevisionsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PortalRevisionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..599ebf5744899 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagHeaders.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.apimanagement.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 PortalRevisionsGetEntityTagHeaders model. */ +@Fluent +public final class PortalRevisionsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PortalRevisionsGetEntityTagHeaders object itself. + */ + public PortalRevisionsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagResponse.java new file mode 100644 index 0000000000000..1335ce34bbeb6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class PortalRevisionsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of PortalRevisionsGetEntityTagResponse. + * + * @param request the request which resulted in this PortalRevisionsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PortalRevisionsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + PortalRevisionsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetHeaders.java new file mode 100644 index 0000000000000..e3caed1df190b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetHeaders.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.apimanagement.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 PortalRevisionsGetHeaders model. */ +@Fluent +public final class PortalRevisionsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PortalRevisionsGetHeaders object itself. + */ + public PortalRevisionsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetResponse.java new file mode 100644 index 0000000000000..150a486231300 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; + +/** Contains all response data for the get operation. */ +public final class PortalRevisionsGetResponse + extends ResponseBase { + /** + * Creates an instance of PortalRevisionsGetResponse. + * + * @param request the request which resulted in this PortalRevisionsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PortalRevisionsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PortalRevisionContractInner value, + PortalRevisionsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PortalRevisionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateHeaders.java new file mode 100644 index 0000000000000..72a1d8d9f5a46 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateHeaders.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.apimanagement.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 PortalRevisionsUpdateHeaders model. */ +@Fluent +public final class PortalRevisionsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalRevisionsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the PortalRevisionsUpdateHeaders object itself. + */ + public PortalRevisionsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateResponse.java new file mode 100644 index 0000000000000..bd631dad4ee59 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalRevisionsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalRevisionContractInner; + +/** Contains all response data for the update operation. */ +public final class PortalRevisionsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of PortalRevisionsUpdateResponse. + * + * @param request the request which resulted in this PortalRevisionsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PortalRevisionsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PortalRevisionContractInner value, + PortalRevisionsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PortalRevisionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingValidationKeyContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingValidationKeyContract.java new file mode 100644 index 0000000000000..4799fdc898701 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingValidationKeyContract.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingValidationKeyContractInner; + +/** An immutable client-side representation of PortalSettingValidationKeyContract. */ +public interface PortalSettingValidationKeyContract { + /** + * Gets the validationKey property: This is secret value of the validation key in portal settings. + * + * @return the validationKey value. + */ + String validationKey(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingValidationKeyContractInner + * object. + * + * @return the inner object. + */ + PortalSettingValidationKeyContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettings.java new file mode 100644 index 0000000000000..af7d0b48a91b5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettings.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PortalSettings. */ +public interface PortalSettings { + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + PortalSettingsCollection listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of portalsettings defined within a service instance.. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return descriptions of APIM policies. + */ + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsCollection.java new file mode 100644 index 0000000000000..507dc0c3452a9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsCollection.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingsCollectionInner; +import java.util.List; + +/** An immutable client-side representation of PortalSettingsCollection. */ +public interface PortalSettingsCollection { + /** + * Gets the value property: Descriptions of APIM policies. + * + * @return the value value. + */ + List value(); + + /** + * Gets the count property: Total record count number. + * + * @return the count value. + */ + Long count(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PortalSettingsCollectionInner object. + * + * @return the inner object. + */ + PortalSettingsCollectionInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsContract.java new file mode 100644 index 0000000000000..9b7f7abd49f02 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSettingsContract.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Portal Settings for the Developer Portal. */ +@JsonFlatten +@Fluent +public class PortalSettingsContract extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PortalSettingsContract.class); + + /* + * A delegation Url. + */ + @JsonProperty(value = "properties.url") + private String url; + + /* + * A base64-encoded validation key to validate, that a request is coming + * from Azure API Management. + */ + @JsonProperty(value = "properties.validationKey") + private String validationKey; + + /* + * Subscriptions delegation settings. + */ + @JsonProperty(value = "properties.subscriptions") + private SubscriptionsDelegationSettingsProperties subscriptions; + + /* + * User registration delegation settings. + */ + @JsonProperty(value = "properties.userRegistration") + private RegistrationDelegationSettingsProperties userRegistration; + + /* + * Redirect Anonymous users to the Sign-In page. + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * Terms of service contract properties. + */ + @JsonProperty(value = "properties.termsOfService") + private TermsOfServiceProperties termsOfService; + + /** + * Get the url property: A delegation Url. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: A delegation Url. + * + * @param url the url value to set. + * @return the PortalSettingsContract object itself. + */ + public PortalSettingsContract withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the validationKey property: A base64-encoded validation key to validate, that a request is coming from Azure + * API Management. + * + * @return the validationKey value. + */ + public String validationKey() { + return this.validationKey; + } + + /** + * Set the validationKey property: A base64-encoded validation key to validate, that a request is coming from Azure + * API Management. + * + * @param validationKey the validationKey value to set. + * @return the PortalSettingsContract object itself. + */ + public PortalSettingsContract withValidationKey(String validationKey) { + this.validationKey = validationKey; + return this; + } + + /** + * Get the subscriptions property: Subscriptions delegation settings. + * + * @return the subscriptions value. + */ + public SubscriptionsDelegationSettingsProperties subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: Subscriptions delegation settings. + * + * @param subscriptions the subscriptions value to set. + * @return the PortalSettingsContract object itself. + */ + public PortalSettingsContract withSubscriptions(SubscriptionsDelegationSettingsProperties subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Get the userRegistration property: User registration delegation settings. + * + * @return the userRegistration value. + */ + public RegistrationDelegationSettingsProperties userRegistration() { + return this.userRegistration; + } + + /** + * Set the userRegistration property: User registration delegation settings. + * + * @param userRegistration the userRegistration value to set. + * @return the PortalSettingsContract object itself. + */ + public PortalSettingsContract withUserRegistration(RegistrationDelegationSettingsProperties userRegistration) { + this.userRegistration = userRegistration; + return this; + } + + /** + * Get the enabled property: Redirect Anonymous users to the Sign-In page. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Redirect Anonymous users to the Sign-In page. + * + * @param enabled the enabled value to set. + * @return the PortalSettingsContract object itself. + */ + public PortalSettingsContract withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the termsOfService property: Terms of service contract properties. + * + * @return the termsOfService value. + */ + public TermsOfServiceProperties termsOfService() { + return this.termsOfService; + } + + /** + * Set the termsOfService property: Terms of service contract properties. + * + * @param termsOfService the termsOfService value to set. + * @return the PortalSettingsContract object itself. + */ + public PortalSettingsContract withTermsOfService(TermsOfServiceProperties termsOfService) { + this.termsOfService = termsOfService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().validate(); + } + if (userRegistration() != null) { + userRegistration().validate(); + } + if (termsOfService() != null) { + termsOfService().validate(); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSigninSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSigninSettings.java new file mode 100644 index 0000000000000..29884484c38dd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSigninSettings.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; + +/** An immutable client-side representation of PortalSigninSettings. */ +public interface PortalSigninSettings { + /** + * 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 enabled property: Redirect Anonymous users to the Sign-In page. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner object. + * + * @return the inner object. + */ + PortalSigninSettingsInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSignupSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSignupSettings.java new file mode 100644 index 0000000000000..22c5f4c463af3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/PortalSignupSettings.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner; + +/** An immutable client-side representation of PortalSignupSettings. */ +public interface PortalSignupSettings { + /** + * 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 enabled property: Allow users to sign up on a developer portal. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the termsOfService property: Terms of service contract properties. + * + * @return the termsOfService value. + */ + TermsOfServiceProperties termsOfService(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner object. + * + * @return the inner object. + */ + PortalSignupSettingsInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductApis.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductApis.java new file mode 100644 index 0000000000000..48c7a0b69c5b5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductApis.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.apimanagement.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 ProductApis. */ +public interface ProductApis { + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Lists a collection of the APIs associated with a product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Api list representation. + */ + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkEntityExists(String resourceGroupName, String serviceName, String productId, String apiId); + + /** + * Checks that API entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context); + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + ApiContract createOrUpdate(String resourceGroupName, String serviceName, String productId, String apiId); + + /** + * Adds an API to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return api details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context); + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, String apiId); + + /** + * Deletes the specified API from the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String apiId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductCollection.java new file mode 100644 index 0000000000000..3b0b8c2e9766f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Products list representation. */ +@Fluent +public final class ProductCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the ProductCollection object itself. + */ + public ProductCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the ProductCollection object itself. + */ + public ProductCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the ProductCollection object itself. + */ + public ProductCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContract.java new file mode 100644 index 0000000000000..9de1950c86e96 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContract.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; + +/** An immutable client-side representation of ProductContract. */ +public interface ProductContract { + /** + * 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 description property: Product description. May include HTML formatting tags. + * + * @return the description value. + */ + String description(); + + /** + * Gets the terms property: Product terms of use. Developers trying to subscribe to the product will be presented + * and required to accept these terms before they can complete the subscription process. + * + * @return the terms value. + */ + String terms(); + + /** + * Gets the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @return the subscriptionRequired value. + */ + Boolean subscriptionRequired(); + + /** + * Gets the approvalRequired property: whether subscription approval is required. If false, new subscriptions will + * be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @return the approvalRequired value. + */ + Boolean approvalRequired(); + + /** + * Gets the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @return the subscriptionsLimit value. + */ + Integer subscriptionsLimit(); + + /** + * Gets the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @return the state value. + */ + ProductState state(); + + /** + * Gets the displayName property: Product name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner object. + * + * @return the inner object. + */ + ProductContractInner innerModel(); + + /** The entirety of the ProductContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProductContract definition stages. */ + interface DefinitionStages { + /** The first stage of the ProductContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProductContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the ProductContract 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.WithDescription, + DefinitionStages.WithTerms, + DefinitionStages.WithSubscriptionRequired, + DefinitionStages.WithApprovalRequired, + DefinitionStages.WithSubscriptionsLimit, + DefinitionStages.WithState, + DefinitionStages.WithDisplayName, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProductContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProductContract create(Context context); + } + /** The stage of the ProductContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Product description. May include HTML formatting tags.. + * + * @param description Product description. May include HTML formatting tags. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ProductContract definition allowing to specify terms. */ + interface WithTerms { + /** + * Specifies the terms property: Product terms of use. Developers trying to subscribe to the product will be + * presented and required to accept these terms before they can complete the subscription process.. + * + * @param terms Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * @return the next definition stage. + */ + WithCreate withTerms(String terms); + } + /** The stage of the ProductContract definition allowing to specify subscriptionRequired. */ + interface WithSubscriptionRequired { + /** + * Specifies the subscriptionRequired property: Whether a product subscription is required for accessing + * APIs included in this product. If true, the product is referred to as "protected" and a valid + * subscription key is required for a request to an API included in the product to succeed. If false, the + * product is referred to as "open" and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product it's value is assumed to be true.. + * + * @param subscriptionRequired Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is + * required for a request to an API included in the product to succeed. If false, the product is + * referred to as "open" and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product it's value is assumed to be + * true. + * @return the next definition stage. + */ + WithCreate withSubscriptionRequired(Boolean subscriptionRequired); + } + /** The stage of the ProductContract definition allowing to specify approvalRequired. */ + interface WithApprovalRequired { + /** + * Specifies the approvalRequired property: whether subscription approval is required. If false, new + * subscriptions will be approved automatically enabling developers to call the product’s APIs immediately + * after subscribing. If true, administrators must manually approve the subscription before the developer + * can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a + * value of false.. + * + * @param approvalRequired whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. + * If true, administrators must manually approve the subscription before the developer can any of the + * product’s APIs. Can be present only if subscriptionRequired property is present and has a value of + * false. + * @return the next definition stage. + */ + WithCreate withApprovalRequired(Boolean approvalRequired); + } + /** The stage of the ProductContract definition allowing to specify subscriptionsLimit. */ + interface WithSubscriptionsLimit { + /** + * Specifies the subscriptionsLimit property: Whether the number of subscriptions a user can have to this + * product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present + * only if subscriptionRequired property is present and has a value of false.. + * + * @param subscriptionsLimit Whether the number of subscriptions a user can have to this product at the same + * time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * @return the next definition stage. + */ + WithCreate withSubscriptionsLimit(Integer subscriptionsLimit); + } + /** The stage of the ProductContract definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: whether product is published or not. Published products are discoverable by + * users of developer portal. Non published products are visible only to administrators. Default state of + * Product is notPublished.. + * + * @param state whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product + * is notPublished. + * @return the next definition stage. + */ + WithCreate withState(ProductState state); + } + /** The stage of the ProductContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Product name.. + * + * @param displayName Product name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the ProductContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the ProductContract resource. + * + * @return the stage of resource update. + */ + ProductContract.Update update(); + + /** The template for ProductContract update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithTerms, + UpdateStages.WithSubscriptionRequired, + UpdateStages.WithApprovalRequired, + UpdateStages.WithSubscriptionsLimit, + UpdateStages.WithState, + UpdateStages.WithDisplayName, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProductContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProductContract apply(Context context); + } + /** The ProductContract update stages. */ + interface UpdateStages { + /** The stage of the ProductContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Product description. May include HTML formatting tags.. + * + * @param description Product description. May include HTML formatting tags. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the ProductContract update allowing to specify terms. */ + interface WithTerms { + /** + * Specifies the terms property: Product terms of use. Developers trying to subscribe to the product will be + * presented and required to accept these terms before they can complete the subscription process.. + * + * @param terms Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * @return the next definition stage. + */ + Update withTerms(String terms); + } + /** The stage of the ProductContract update allowing to specify subscriptionRequired. */ + interface WithSubscriptionRequired { + /** + * Specifies the subscriptionRequired property: Whether a product subscription is required for accessing + * APIs included in this product. If true, the product is referred to as "protected" and a valid + * subscription key is required for a request to an API included in the product to succeed. If false, the + * product is referred to as "open" and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product it's value is assumed to be true.. + * + * @param subscriptionRequired Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is + * required for a request to an API included in the product to succeed. If false, the product is + * referred to as "open" and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product it's value is assumed to be + * true. + * @return the next definition stage. + */ + Update withSubscriptionRequired(Boolean subscriptionRequired); + } + /** The stage of the ProductContract update allowing to specify approvalRequired. */ + interface WithApprovalRequired { + /** + * Specifies the approvalRequired property: whether subscription approval is required. If false, new + * subscriptions will be approved automatically enabling developers to call the product’s APIs immediately + * after subscribing. If true, administrators must manually approve the subscription before the developer + * can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a + * value of false.. + * + * @param approvalRequired whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. + * If true, administrators must manually approve the subscription before the developer can any of the + * product’s APIs. Can be present only if subscriptionRequired property is present and has a value of + * false. + * @return the next definition stage. + */ + Update withApprovalRequired(Boolean approvalRequired); + } + /** The stage of the ProductContract update allowing to specify subscriptionsLimit. */ + interface WithSubscriptionsLimit { + /** + * Specifies the subscriptionsLimit property: Whether the number of subscriptions a user can have to this + * product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present + * only if subscriptionRequired property is present and has a value of false.. + * + * @param subscriptionsLimit Whether the number of subscriptions a user can have to this product at the same + * time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * @return the next definition stage. + */ + Update withSubscriptionsLimit(Integer subscriptionsLimit); + } + /** The stage of the ProductContract update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: whether product is published or not. Published products are discoverable by + * users of developer portal. Non published products are visible only to administrators. Default state of + * Product is notPublished.. + * + * @param state whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product + * is notPublished. + * @return the next definition stage. + */ + Update withState(ProductState state); + } + /** The stage of the ProductContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Product name.. + * + * @param displayName Product name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the ProductContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProductContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProductContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContractProperties.java new file mode 100644 index 0000000000000..37885895cf2af --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductContractProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Product profile. */ +@Fluent +public final class ProductContractProperties extends ProductEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductContractProperties.class); + + /* + * Product name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /** + * Get the displayName property: Product name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Product name. + * + * @param displayName the displayName value to set. + * @return the ProductContractProperties object itself. + */ + public ProductContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductContractProperties withTerms(String terms) { + super.withTerms(terms); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductContractProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductContractProperties withApprovalRequired(Boolean approvalRequired) { + super.withApprovalRequired(approvalRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductContractProperties withSubscriptionsLimit(Integer subscriptionsLimit) { + super.withSubscriptionsLimit(subscriptionsLimit); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductContractProperties withState(ProductState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (displayName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property displayName in model ProductContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductEntityBaseParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductEntityBaseParameters.java new file mode 100644 index 0000000000000..7727ddc585b10 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductEntityBaseParameters.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Product Entity Base Parameters. */ +@Fluent +public class ProductEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductEntityBaseParameters.class); + + /* + * Product description. May include HTML formatting tags. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Product terms of use. Developers trying to subscribe to the product will + * be presented and required to accept these terms before they can complete + * the subscription process. + */ + @JsonProperty(value = "terms") + private String terms; + + /* + * Whether a product subscription is required for accessing APIs included + * in this product. If true, the product is referred to as "protected" and + * a valid subscription key is required for a request to an API included in + * the product to succeed. If false, the product is referred to as "open" + * and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product + * it's value is assumed to be true. + */ + @JsonProperty(value = "subscriptionRequired") + private Boolean subscriptionRequired; + + /* + * whether subscription approval is required. If false, new subscriptions + * will be approved automatically enabling developers to call the product’s + * APIs immediately after subscribing. If true, administrators must + * manually approve the subscription before the developer can any of the + * product’s APIs. Can be present only if subscriptionRequired property is + * present and has a value of false. + */ + @JsonProperty(value = "approvalRequired") + private Boolean approvalRequired; + + /* + * Whether the number of subscriptions a user can have to this product at + * the same time. Set to null or omit to allow unlimited per user + * subscriptions. Can be present only if subscriptionRequired property is + * present and has a value of false. + */ + @JsonProperty(value = "subscriptionsLimit") + private Integer subscriptionsLimit; + + /* + * whether product is published or not. Published products are discoverable + * by users of developer portal. Non published products are visible only to + * administrators. Default state of Product is notPublished. + */ + @JsonProperty(value = "state") + private ProductState state; + + /** + * Get the description property: Product description. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Product description. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ProductEntityBaseParameters object itself. + */ + public ProductEntityBaseParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the terms property: Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * + * @return the terms value. + */ + public String terms() { + return this.terms; + } + + /** + * Set the terms property: Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * + * @param terms the terms value to set. + * @return the ProductEntityBaseParameters object itself. + */ + public ProductEntityBaseParameters withTerms(String terms) { + this.terms = terms; + return this; + } + + /** + * Get the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ProductEntityBaseParameters object itself. + */ + public ProductEntityBaseParameters withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Get the approvalRequired property: whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @return the approvalRequired value. + */ + public Boolean approvalRequired() { + return this.approvalRequired; + } + + /** + * Set the approvalRequired property: whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @param approvalRequired the approvalRequired value to set. + * @return the ProductEntityBaseParameters object itself. + */ + public ProductEntityBaseParameters withApprovalRequired(Boolean approvalRequired) { + this.approvalRequired = approvalRequired; + return this; + } + + /** + * Get the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @return the subscriptionsLimit value. + */ + public Integer subscriptionsLimit() { + return this.subscriptionsLimit; + } + + /** + * Set the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @param subscriptionsLimit the subscriptionsLimit value to set. + * @return the ProductEntityBaseParameters object itself. + */ + public ProductEntityBaseParameters withSubscriptionsLimit(Integer subscriptionsLimit) { + this.subscriptionsLimit = subscriptionsLimit; + return this; + } + + /** + * Get the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @return the state value. + */ + public ProductState state() { + return this.state; + } + + /** + * Set the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @param state the state value to set. + * @return the ProductEntityBaseParameters object itself. + */ + public ProductEntityBaseParameters withState(ProductState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductGroups.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductGroups.java new file mode 100644 index 0000000000000..0661663b9d873 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductGroups.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.apimanagement.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 ProductGroups. */ +public interface ProductGroups { + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Lists the collection of developer groups associated with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | |</br>| displayName | filter | eq, ne | |</br>| description | filter | eq, ne | + * |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 checkEntityExists(String resourceGroupName, String serviceName, String productId, String groupId); + + /** + * Checks that Group entity specified by identifier is associated with the Product entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response checkEntityExistsWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context); + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + GroupContract createOrUpdate(String resourceGroupName, String serviceName, String productId, String groupId); + + /** + * Adds the association between the specified developer group with the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contract details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context); + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, String groupId); + + /** + * Deletes the association between the specified group and product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param groupId Group identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String productId, String groupId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPolicies.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPolicies.java new file mode 100644 index 0000000000000..6371db067587c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPolicies.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Resource collection API of ProductPolicies. */ +public interface ProductPolicies { + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + PolicyCollection listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + Response listByProductWithResponse( + String resourceGroupName, String serviceName, String productId, Context context); + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 getEntityTag(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId); + + /** + * Get the ETag of the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 ETag of the policy configuration at the Product level. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, PolicyIdName policyId, Context context); + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the 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 policy configuration at the Product level. + */ + PolicyContract get(String resourceGroupName, String serviceName, String productId, PolicyIdName policyId); + + /** + * Get the policy configuration at the Product level. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param format Policy Export Format. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy configuration at the Product level. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyExportFormat format, + Context context); + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + PolicyContract createOrUpdate( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters); + + /** + * Creates or updates policy configuration for the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param parameters The policy contents to apply. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return policy Contract details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + PolicyContractInner parameters, + String ifMatch, + Context context); + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, PolicyIdName policyId, String ifMatch); + + /** + * Deletes the policy configuration at the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param policyId The identifier of the Policy. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + PolicyIdName policyId, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..7ae2caf9dc161 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateHeaders.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.apimanagement.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 ProductPoliciesCreateOrUpdateHeaders model. */ +@Fluent +public final class ProductPoliciesCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductPoliciesCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductPoliciesCreateOrUpdateHeaders object itself. + */ + public ProductPoliciesCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..2f4530062ee8b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ProductPoliciesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ProductPoliciesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ProductPoliciesCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductPoliciesCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + ProductPoliciesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagHeaders.java new file mode 100644 index 0000000000000..18352bb48fd96 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagHeaders.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.apimanagement.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 ProductPoliciesGetEntityTagHeaders model. */ +@Fluent +public final class ProductPoliciesGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductPoliciesGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductPoliciesGetEntityTagHeaders object itself. + */ + public ProductPoliciesGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagResponse.java new file mode 100644 index 0000000000000..5c2c3eab7be27 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ProductPoliciesGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ProductPoliciesGetEntityTagResponse. + * + * @param request the request which resulted in this ProductPoliciesGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductPoliciesGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ProductPoliciesGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetHeaders.java new file mode 100644 index 0000000000000..fd5ec06b91d4f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetHeaders.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.apimanagement.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 ProductPoliciesGetHeaders model. */ +@Fluent +public final class ProductPoliciesGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductPoliciesGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductPoliciesGetHeaders object itself. + */ + public ProductPoliciesGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetResponse.java new file mode 100644 index 0000000000000..84ab7c0ae6d47 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductPoliciesGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PolicyContractInner; + +/** Contains all response data for the get operation. */ +public final class ProductPoliciesGetResponse extends ResponseBase { + /** + * Creates an instance of ProductPoliciesGetResponse. + * + * @param request the request which resulted in this ProductPoliciesGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductPoliciesGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PolicyContractInner value, + ProductPoliciesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PolicyContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductState.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductState.java new file mode 100644 index 0000000000000..40a9648982989 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductState.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProductState. */ +public enum ProductState { + /** Enum value notPublished. */ + NOT_PUBLISHED("notPublished"), + + /** Enum value published. */ + PUBLISHED("published"); + + /** The actual serialized value for a ProductState instance. */ + private final String value; + + ProductState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProductState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProductState object, or null if unable to parse. + */ + @JsonCreator + public static ProductState fromString(String value) { + ProductState[] items = ProductState.values(); + for (ProductState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductSubscriptions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductSubscriptions.java new file mode 100644 index 0000000000000..6ab20f4c48bc1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductSubscriptions.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ProductSubscriptions. */ +public interface ProductSubscriptions { + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + PagedIterable list(String resourceGroupName, String serviceName, String productId); + + /** + * Lists the collection of subscriptions to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + PagedIterable list( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductTagResourceContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductTagResourceContractProperties.java new file mode 100644 index 0000000000000..bc2ab4bd2385c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductTagResourceContractProperties.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.apimanagement.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; + +/** Product profile. */ +@Fluent +public final class ProductTagResourceContractProperties extends ProductEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductTagResourceContractProperties.class); + + /* + * Identifier of the product in the form of /products/{productId} + */ + @JsonProperty(value = "id") + private String id; + + /* + * Product name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the id property: Identifier of the product in the form of /products/{productId}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Identifier of the product in the form of /products/{productId}. + * + * @param id the id value to set. + * @return the ProductTagResourceContractProperties object itself. + */ + public ProductTagResourceContractProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Product name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Product name. + * + * @param name the name value to set. + * @return the ProductTagResourceContractProperties object itself. + */ + public ProductTagResourceContractProperties withName(String name) { + this.name = name; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductTagResourceContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductTagResourceContractProperties withTerms(String terms) { + super.withTerms(terms); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductTagResourceContractProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductTagResourceContractProperties withApprovalRequired(Boolean approvalRequired) { + super.withApprovalRequired(approvalRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductTagResourceContractProperties withSubscriptionsLimit(Integer subscriptionsLimit) { + super.withSubscriptionsLimit(subscriptionsLimit); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductTagResourceContractProperties withState(ProductState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ProductTagResourceContractProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateParameters.java new file mode 100644 index 0000000000000..88dc489bee485 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateParameters.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.apimanagement.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; + +/** Product Update parameters. */ +@JsonFlatten +@Fluent +public class ProductUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductUpdateParameters.class); + + /* + * Product description. May include HTML formatting tags. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Product terms of use. Developers trying to subscribe to the product will + * be presented and required to accept these terms before they can complete + * the subscription process. + */ + @JsonProperty(value = "properties.terms") + private String terms; + + /* + * Whether a product subscription is required for accessing APIs included + * in this product. If true, the product is referred to as "protected" and + * a valid subscription key is required for a request to an API included in + * the product to succeed. If false, the product is referred to as "open" + * and requests to an API included in the product can be made without a + * subscription key. If property is omitted when creating a new product + * it's value is assumed to be true. + */ + @JsonProperty(value = "properties.subscriptionRequired") + private Boolean subscriptionRequired; + + /* + * whether subscription approval is required. If false, new subscriptions + * will be approved automatically enabling developers to call the product’s + * APIs immediately after subscribing. If true, administrators must + * manually approve the subscription before the developer can any of the + * product’s APIs. Can be present only if subscriptionRequired property is + * present and has a value of false. + */ + @JsonProperty(value = "properties.approvalRequired") + private Boolean approvalRequired; + + /* + * Whether the number of subscriptions a user can have to this product at + * the same time. Set to null or omit to allow unlimited per user + * subscriptions. Can be present only if subscriptionRequired property is + * present and has a value of false. + */ + @JsonProperty(value = "properties.subscriptionsLimit") + private Integer subscriptionsLimit; + + /* + * whether product is published or not. Published products are discoverable + * by users of developer portal. Non published products are visible only to + * administrators. Default state of Product is notPublished. + */ + @JsonProperty(value = "properties.state") + private ProductState state; + + /* + * Product name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get the description property: Product description. May include HTML formatting tags. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Product description. May include HTML formatting tags. + * + * @param description the description value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the terms property: Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * + * @return the terms value. + */ + public String terms() { + return this.terms; + } + + /** + * Set the terms property: Product terms of use. Developers trying to subscribe to the product will be presented and + * required to accept these terms before they can complete the subscription process. + * + * @param terms the terms value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withTerms(String terms) { + this.terms = terms; + return this; + } + + /** + * Get the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @return the subscriptionRequired value. + */ + public Boolean subscriptionRequired() { + return this.subscriptionRequired; + } + + /** + * Set the subscriptionRequired property: Whether a product subscription is required for accessing APIs included in + * this product. If true, the product is referred to as "protected" and a valid subscription key is required for a + * request to an API included in the product to succeed. If false, the product is referred to as "open" and requests + * to an API included in the product can be made without a subscription key. If property is omitted when creating a + * new product it's value is assumed to be true. + * + * @param subscriptionRequired the subscriptionRequired value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withSubscriptionRequired(Boolean subscriptionRequired) { + this.subscriptionRequired = subscriptionRequired; + return this; + } + + /** + * Get the approvalRequired property: whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @return the approvalRequired value. + */ + public Boolean approvalRequired() { + return this.approvalRequired; + } + + /** + * Set the approvalRequired property: whether subscription approval is required. If false, new subscriptions will be + * approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, + * administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be + * present only if subscriptionRequired property is present and has a value of false. + * + * @param approvalRequired the approvalRequired value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withApprovalRequired(Boolean approvalRequired) { + this.approvalRequired = approvalRequired; + return this; + } + + /** + * Get the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @return the subscriptionsLimit value. + */ + public Integer subscriptionsLimit() { + return this.subscriptionsLimit; + } + + /** + * Set the subscriptionsLimit property: Whether the number of subscriptions a user can have to this product at the + * same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if + * subscriptionRequired property is present and has a value of false. + * + * @param subscriptionsLimit the subscriptionsLimit value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withSubscriptionsLimit(Integer subscriptionsLimit) { + this.subscriptionsLimit = subscriptionsLimit; + return this; + } + + /** + * Get the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @return the state value. + */ + public ProductState state() { + return this.state; + } + + /** + * Set the state property: whether product is published or not. Published products are discoverable by users of + * developer portal. Non published products are visible only to administrators. Default state of Product is + * notPublished. + * + * @param state the state value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withState(ProductState state) { + this.state = state; + return this; + } + + /** + * Get the displayName property: Product name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Product name. + * + * @param displayName the displayName value to set. + * @return the ProductUpdateParameters object itself. + */ + public ProductUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateProperties.java new file mode 100644 index 0000000000000..1ed5f9da9055d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductUpdateProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Parameters supplied to the Update Product operation. */ +@Fluent +public final class ProductUpdateProperties extends ProductEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductUpdateProperties.class); + + /* + * Product name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the displayName property: Product name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Product name. + * + * @param displayName the displayName value to set. + * @return the ProductUpdateProperties object itself. + */ + public ProductUpdateProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductUpdateProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductUpdateProperties withTerms(String terms) { + super.withTerms(terms); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductUpdateProperties withSubscriptionRequired(Boolean subscriptionRequired) { + super.withSubscriptionRequired(subscriptionRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductUpdateProperties withApprovalRequired(Boolean approvalRequired) { + super.withApprovalRequired(approvalRequired); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductUpdateProperties withSubscriptionsLimit(Integer subscriptionsLimit) { + super.withSubscriptionsLimit(subscriptionsLimit); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProductUpdateProperties withState(ProductState state) { + super.withState(state); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Products.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Products.java new file mode 100644 index 0000000000000..5dc1050ac6668 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Products.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Products. */ +public interface Products { + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of products in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| groups | expand + * | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups When set to true, the response contains an array of groups that have visibility to the + * product. The default is false. + * @param tags Products which are part of a specific tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Products list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + String tags, + Context context); + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String productId); + + /** + * Gets the entity state (Etag) version of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the product specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String productId, Context context); + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + ProductContract get(String resourceGroupName, String serviceName, String productId); + + /** + * Gets the details of the product specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String productId, Context context); + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String productId, String ifMatch); + + /** + * Delete product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String productId, + String ifMatch, + Boolean deleteSubscriptions, + Context context); + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByTags(String resourceGroupName, String serviceName); + + /** + * Lists a collection of products associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, + * lt | substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | substringof, contains, + * startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param includeNotTaggedProducts Include not tagged Products. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByTags( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean includeNotTaggedProducts, + Context context); + + /** + * Gets the details of the product specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + ProductContract getById(String id); + + /** + * Gets the details of the product specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the product specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete product. + * + * @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); + + /** + * Delete product. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Delete existing subscriptions associated with the product or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Boolean deleteSubscriptions, Context context); + + /** + * Begins definition for a new ProductContract resource. + * + * @param name resource name. + * @return the first stage of the new ProductContract definition. + */ + ProductContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..af3fb8b432348 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateHeaders.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.apimanagement.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 ProductsCreateOrUpdateHeaders model. */ +@Fluent +public final class ProductsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductsCreateOrUpdateHeaders object itself. + */ + public ProductsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..37f4119ddf84e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class ProductsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ProductsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ProductsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ProductContractInner value, + ProductsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ProductContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..8473a582071d6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagHeaders.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.apimanagement.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 ProductsGetEntityTagHeaders model. */ +@Fluent +public final class ProductsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductsGetEntityTagHeaders object itself. + */ + public ProductsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagResponse.java new file mode 100644 index 0000000000000..c81c8a7e9608e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class ProductsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of ProductsGetEntityTagResponse. + * + * @param request the request which resulted in this ProductsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductsGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, ProductsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetHeaders.java new file mode 100644 index 0000000000000..acd0b694195a2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetHeaders.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.apimanagement.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 ProductsGetHeaders model. */ +@Fluent +public final class ProductsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductsGetHeaders object itself. + */ + public ProductsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetResponse.java new file mode 100644 index 0000000000000..58dc60d8d498f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; + +/** Contains all response data for the get operation. */ +public final class ProductsGetResponse extends ResponseBase { + /** + * Creates an instance of ProductsGetResponse. + * + * @param request the request which resulted in this ProductsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ProductContractInner value, + ProductsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ProductContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateHeaders.java new file mode 100644 index 0000000000000..5409aed559b97 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateHeaders.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.apimanagement.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 ProductsUpdateHeaders model. */ +@Fluent +public final class ProductsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProductsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the ProductsUpdateHeaders object itself. + */ + public ProductsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateResponse.java new file mode 100644 index 0000000000000..895fe9325acc8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProductsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner; + +/** Contains all response data for the update operation. */ +public final class ProductsUpdateResponse extends ResponseBase { + /** + * Creates an instance of ProductsUpdateResponse. + * + * @param request the request which resulted in this ProductsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ProductsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ProductContractInner value, + ProductsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ProductContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Protocol.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Protocol.java new file mode 100644 index 0000000000000..85ff5b056f1af --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Protocol.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Protocol. */ +public enum Protocol { + /** Enum value http. */ + HTTP("http"), + + /** Enum value https. */ + HTTPS("https"); + + /** The actual serialized value for a Protocol instance. */ + private final String value; + + Protocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Protocol instance. + * + * @param value the serialized value to parse. + * @return the parsed Protocol object, or null if unable to parse. + */ + @JsonCreator + public static Protocol fromString(String value) { + Protocol[] items = Protocol.values(); + for (Protocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProvisioningState.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProvisioningState.java new file mode 100644 index 0000000000000..268376b720a0d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ProvisioningState.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProvisioningState. */ +public enum ProvisioningState { + /** Enum value created. */ + CREATED("created"); + + /** The actual serialized value for a ProvisioningState instance. */ + private final String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByCounterKeys.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByCounterKeys.java new file mode 100644 index 0000000000000..7062c6c4f2da0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByCounterKeys.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of QuotaByCounterKeys. */ +public interface QuotaByCounterKeys { + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + QuotaCounterCollection listByService(String resourceGroupName, String serviceName, String quotaCounterKey); + + /** + * Lists a collection of current quota counter periods associated with the counter-key configured in the policy on + * the specified service instance. The api does not support paging yet. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + Response listByServiceWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, Context context); + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + QuotaCounterCollection update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters); + + /** + * Updates all the quota counter values specified with the existing quota counter key to a value in the specified + * service instance. This should be used for reset of the quota counter values. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param parameters The value of the quota counter to be applied to all quota counter periods. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Quota Counter list representation. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + QuotaCounterValueUpdateContract parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByPeriodKeys.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByPeriodKeys.java new file mode 100644 index 0000000000000..9c8e792e76d16 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaByPeriodKeys.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of QuotaByPeriodKeys. */ +public interface QuotaByPeriodKeys { + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + QuotaCounterContract get( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey); + + /** + * Gets the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the value of the quota counter associated with the counter-key in the policy for the specific period in + * service instance. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String quotaCounterKey, String quotaPeriodKey, Context context); + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + QuotaCounterContract update( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters); + + /** + * Updates an existing quota counter value in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param quotaCounterKey Quota counter key identifier.This is the result of expression defined in counter-key + * attribute of the quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s + * accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible + * by "ba" key. + * @param quotaPeriodKey Quota period key identifier. + * @param parameters The value of the Quota counter to be applied on the specified period. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota counter details. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String quotaCounterKey, + String quotaPeriodKey, + QuotaCounterValueUpdateContract parameters, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterCollection.java new file mode 100644 index 0000000000000..c59f5e657860b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterCollection.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterCollectionInner; +import java.util.List; + +/** An immutable client-side representation of QuotaCounterCollection. */ +public interface QuotaCounterCollection { + /** + * Gets the value property: Quota counter values. + * + * @return the value value. + */ + List value(); + + /** + * Gets the count property: Total record count number across all pages. + * + * @return the count value. + */ + Long count(); + + /** + * Gets the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterCollectionInner object. + * + * @return the inner object. + */ + QuotaCounterCollectionInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterContract.java new file mode 100644 index 0000000000000..79e87b6dd1563 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of QuotaCounterContract. */ +public interface QuotaCounterContract { + /** + * Gets the counterKey property: The Key value of the Counter. Must not be empty. + * + * @return the counterKey value. + */ + String counterKey(); + + /** + * Gets the periodKey property: Identifier of the Period for which the counter was collected. Must not be empty. + * + * @return the periodKey value. + */ + String periodKey(); + + /** + * Gets the periodStartTime property: The date of the start of Counter Period. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the periodStartTime value. + */ + OffsetDateTime periodStartTime(); + + /** + * Gets the periodEndTime property: The date of the end of Counter Period. The date conforms to the following + * format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the periodEndTime value. + */ + OffsetDateTime periodEndTime(); + + /** + * Gets the value property: Quota Value Properties. + * + * @return the value value. + */ + QuotaCounterValueContractProperties value(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.QuotaCounterContractInner object. + * + * @return the inner object. + */ + QuotaCounterContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueContractProperties.java new file mode 100644 index 0000000000000..1971a5c242aa9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueContractProperties.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.apimanagement.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; + +/** Quota counter value details. */ +@Fluent +public final class QuotaCounterValueContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaCounterValueContractProperties.class); + + /* + * Number of times Counter was called. + */ + @JsonProperty(value = "callsCount") + private Integer callsCount; + + /* + * Data Transferred in KiloBytes. + */ + @JsonProperty(value = "kbTransferred") + private Double kbTransferred; + + /** + * Get the callsCount property: Number of times Counter was called. + * + * @return the callsCount value. + */ + public Integer callsCount() { + return this.callsCount; + } + + /** + * Set the callsCount property: Number of times Counter was called. + * + * @param callsCount the callsCount value to set. + * @return the QuotaCounterValueContractProperties object itself. + */ + public QuotaCounterValueContractProperties withCallsCount(Integer callsCount) { + this.callsCount = callsCount; + return this; + } + + /** + * Get the kbTransferred property: Data Transferred in KiloBytes. + * + * @return the kbTransferred value. + */ + public Double kbTransferred() { + return this.kbTransferred; + } + + /** + * Set the kbTransferred property: Data Transferred in KiloBytes. + * + * @param kbTransferred the kbTransferred value to set. + * @return the QuotaCounterValueContractProperties object itself. + */ + public QuotaCounterValueContractProperties withKbTransferred(Double kbTransferred) { + this.kbTransferred = kbTransferred; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueUpdateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueUpdateContract.java new file mode 100644 index 0000000000000..7d7b2269be7b3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/QuotaCounterValueUpdateContract.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.apimanagement.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; + +/** Quota counter value details. */ +@JsonFlatten +@Fluent +public class QuotaCounterValueUpdateContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaCounterValueUpdateContract.class); + + /* + * Number of times Counter was called. + */ + @JsonProperty(value = "properties.callsCount") + private Integer callsCount; + + /* + * Data Transferred in KiloBytes. + */ + @JsonProperty(value = "properties.kbTransferred") + private Double kbTransferred; + + /** + * Get the callsCount property: Number of times Counter was called. + * + * @return the callsCount value. + */ + public Integer callsCount() { + return this.callsCount; + } + + /** + * Set the callsCount property: Number of times Counter was called. + * + * @param callsCount the callsCount value to set. + * @return the QuotaCounterValueUpdateContract object itself. + */ + public QuotaCounterValueUpdateContract withCallsCount(Integer callsCount) { + this.callsCount = callsCount; + return this; + } + + /** + * Get the kbTransferred property: Data Transferred in KiloBytes. + * + * @return the kbTransferred value. + */ + public Double kbTransferred() { + return this.kbTransferred; + } + + /** + * Set the kbTransferred property: Data Transferred in KiloBytes. + * + * @param kbTransferred the kbTransferred value to set. + * @return the QuotaCounterValueUpdateContract object itself. + */ + public QuotaCounterValueUpdateContract withKbTransferred(Double kbTransferred) { + this.kbTransferred = kbTransferred; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailCollection.java new file mode 100644 index 0000000000000..8c17720201e8a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailCollection.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailCollectionInner; +import java.util.List; + +/** An immutable client-side representation of RecipientEmailCollection. */ +public interface RecipientEmailCollection { + /** + * Gets the value property: Page values. + * + * @return the value value. + */ + List value(); + + /** + * Gets the count property: Total record count number across all pages. + * + * @return the count value. + */ + Long count(); + + /** + * Gets the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailCollectionInner object. + * + * @return the inner object. + */ + RecipientEmailCollectionInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailContract.java new file mode 100644 index 0000000000000..24cf5b0856017 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientEmailContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner; + +/** An immutable client-side representation of RecipientEmailContract. */ +public interface RecipientEmailContract { + /** + * 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 email property: User Email subscribed to notification. + * + * @return the email value. + */ + String email(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.RecipientEmailContractInner object. + * + * @return the inner object. + */ + RecipientEmailContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserCollection.java new file mode 100644 index 0000000000000..695515e981fd6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserCollection.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserCollectionInner; +import java.util.List; + +/** An immutable client-side representation of RecipientUserCollection. */ +public interface RecipientUserCollection { + /** + * Gets the value property: Page values. + * + * @return the value value. + */ + List value(); + + /** + * Gets the count property: Total record count number across all pages. + * + * @return the count value. + */ + Long count(); + + /** + * Gets the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserCollectionInner object. + * + * @return the inner object. + */ + RecipientUserCollectionInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserContract.java new file mode 100644 index 0000000000000..4a58a84e77699 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientUserContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner; + +/** An immutable client-side representation of RecipientUserContract. */ +public interface RecipientUserContract { + /** + * 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 userId property: API Management UserId subscribed to notification. + * + * @return the userId value. + */ + String userId(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.RecipientUserContractInner object. + * + * @return the inner object. + */ + RecipientUserContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientsContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientsContractProperties.java new file mode 100644 index 0000000000000..e73534f261c92 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RecipientsContractProperties.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.apimanagement.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; + +/** Notification Parameter contract. */ +@Fluent +public final class RecipientsContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecipientsContractProperties.class); + + /* + * List of Emails subscribed for the notification. + */ + @JsonProperty(value = "emails") + private List emails; + + /* + * List of Users subscribed for the notification. + */ + @JsonProperty(value = "users") + private List users; + + /** + * Get the emails property: List of Emails subscribed for the notification. + * + * @return the emails value. + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails property: List of Emails subscribed for the notification. + * + * @param emails the emails value to set. + * @return the RecipientsContractProperties object itself. + */ + public RecipientsContractProperties withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Get the users property: List of Users subscribed for the notification. + * + * @return the users value. + */ + public List users() { + return this.users; + } + + /** + * Set the users property: List of Users subscribed for the notification. + * + * @param users the users value to set. + * @return the RecipientsContractProperties object itself. + */ + public RecipientsContractProperties withUsers(List users) { + this.users = users; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionContract.java new file mode 100644 index 0000000000000..4382f76484d8f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.RegionContractInner; + +/** An immutable client-side representation of RegionContract. */ +public interface RegionContract { + /** + * Gets the name property: Region name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isMasterRegion property: whether Region is the master region. + * + * @return the isMasterRegion value. + */ + Boolean isMasterRegion(); + + /** + * Gets the isDeleted property: whether Region is deleted. + * + * @return the isDeleted value. + */ + Boolean isDeleted(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.RegionContractInner object. + * + * @return the inner object. + */ + RegionContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionListResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionListResult.java new file mode 100644 index 0000000000000..7f33ce0ca20e0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegionListResult.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.RegionContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Lists Regions operation response details. */ +@Fluent +public final class RegionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionListResult.class); + + /* + * Lists of Regions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Lists of Regions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Lists of Regions. + * + * @param value the value value to set. + * @return the RegionListResult object itself. + */ + public RegionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the RegionListResult object itself. + */ + public RegionListResult withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the RegionListResult object itself. + */ + public RegionListResult 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Regions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Regions.java new file mode 100644 index 0000000000000..e8b3f0f1dbbf3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Regions.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Regions. */ +public interface Regions { + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists all azure regions in which the service exists. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lists Regions operation response details. + */ + PagedIterable listByService(String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegistrationDelegationSettingsProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegistrationDelegationSettingsProperties.java new file mode 100644 index 0000000000000..085570633b1c4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RegistrationDelegationSettingsProperties.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.apimanagement.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; + +/** User registration delegation settings properties. */ +@Fluent +public final class RegistrationDelegationSettingsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistrationDelegationSettingsProperties.class); + + /* + * Enable or disable delegation for user registration. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the enabled property: Enable or disable delegation for user registration. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable or disable delegation for user registration. + * + * @param enabled the enabled value to set. + * @return the RegistrationDelegationSettingsProperties object itself. + */ + public RegistrationDelegationSettingsProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportCollection.java new file mode 100644 index 0000000000000..58865422bbca0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ReportRecordContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Report records list representation. */ +@Fluent +public final class ReportCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReportCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the ReportCollection object itself. + */ + public ReportCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the ReportCollection object itself. + */ + public ReportCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the ReportCollection object itself. + */ + public ReportCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportRecordContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportRecordContract.java new file mode 100644 index 0000000000000..101edb532c099 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ReportRecordContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ReportRecordContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ReportRecordContract. */ +public interface ReportRecordContract { + /** + * Gets the name property: Name depending on report endpoint specifies product, API, operation or developer name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the timestamp property: Start of aggregation period. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the timestamp value. + */ + OffsetDateTime timestamp(); + + /** + * Gets the interval property: Length of aggregation period. Interval must be multiple of 15 minutes and may not be + * zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + * + * @return the interval value. + */ + String interval(); + + /** + * Gets the country property: Country to which this record data is related. + * + * @return the country value. + */ + String country(); + + /** + * Gets the region property: Country region to which this record data is related. + * + * @return the region value. + */ + String region(); + + /** + * Gets the zip property: Zip code to which this record data is related. + * + * @return the zip value. + */ + String zip(); + + /** + * Gets the userId property: User identifier path. /users/{userId}. + * + * @return the userId value. + */ + String userId(); + + /** + * Gets the productId property: Product identifier path. /products/{productId}. + * + * @return the productId value. + */ + String productId(); + + /** + * Gets the apiId property: API identifier path. /apis/{apiId}. + * + * @return the apiId value. + */ + String apiId(); + + /** + * Gets the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}. + * + * @return the operationId value. + */ + String operationId(); + + /** + * Gets the apiRegion property: API region identifier. + * + * @return the apiRegion value. + */ + String apiRegion(); + + /** + * Gets the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the callCountSuccess property: Number of successful calls. This includes calls returning HttpStatusCode + * <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect. + * + * @return the callCountSuccess value. + */ + Integer callCountSuccess(); + + /** + * Gets the callCountBlocked property: Number of calls blocked due to invalid credentials. This includes calls + * returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests. + * + * @return the callCountBlocked value. + */ + Integer callCountBlocked(); + + /** + * Gets the callCountFailed property: Number of calls failed due to proxy or backend errors. This includes calls + * returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600. + * + * @return the callCountFailed value. + */ + Integer callCountFailed(); + + /** + * Gets the callCountOther property: Number of other calls. + * + * @return the callCountOther value. + */ + Integer callCountOther(); + + /** + * Gets the callCountTotal property: Total number of calls. + * + * @return the callCountTotal value. + */ + Integer callCountTotal(); + + /** + * Gets the bandwidth property: Bandwidth consumed. + * + * @return the bandwidth value. + */ + Long bandwidth(); + + /** + * Gets the cacheHitCount property: Number of times when content was served from cache policy. + * + * @return the cacheHitCount value. + */ + Integer cacheHitCount(); + + /** + * Gets the cacheMissCount property: Number of times content was fetched from backend. + * + * @return the cacheMissCount value. + */ + Integer cacheMissCount(); + + /** + * Gets the apiTimeAvg property: Average time it took to process request. + * + * @return the apiTimeAvg value. + */ + Double apiTimeAvg(); + + /** + * Gets the apiTimeMin property: Minimum time it took to process request. + * + * @return the apiTimeMin value. + */ + Double apiTimeMin(); + + /** + * Gets the apiTimeMax property: Maximum time it took to process request. + * + * @return the apiTimeMax value. + */ + Double apiTimeMax(); + + /** + * Gets the serviceTimeAvg property: Average time it took to process request on backend. + * + * @return the serviceTimeAvg value. + */ + Double serviceTimeAvg(); + + /** + * Gets the serviceTimeMin property: Minimum time it took to process request on backend. + * + * @return the serviceTimeMin value. + */ + Double serviceTimeMin(); + + /** + * Gets the serviceTimeMax property: Maximum time it took to process request on backend. + * + * @return the serviceTimeMax value. + */ + Double serviceTimeMax(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ReportRecordContractInner object. + * + * @return the inner object. + */ + ReportRecordContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Reports.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Reports.java new file mode 100644 index 0000000000000..a6f21b392dc2b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Reports.java @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import java.time.Duration; + +/** Resource collection API of Reports. */ +public interface Reports { + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByApi(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter The filter to apply on the operation. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByUser(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| userId | select, filter | eq | | + * </br>| apiRegion | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId + * | filter | eq | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | + * </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | + * </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | + * </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | + * </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByUser( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByOperation(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by API Operations. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | select, filter | eq | | </br>| + * callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, orderBy | | | </br>| + * callCountFailed | select, orderBy | | | </br>| callCountOther | select, orderBy | | | </br>| + * callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | | | </br>| + * cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select, + * orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByProduct(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId | + * filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked | select, + * orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | select, + * orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, orderBy | + * | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| + * apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | + * | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| + * serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByGeo(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by geography. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| country | select | | | </br>| region | select | | | </br>| zip | select | | | + * </br>| apiRegion | filter | eq | | </br>| userId | filter | eq | | </br>| productId | + * filter | eq | | </br>| subscriptionId | filter | eq | | </br>| apiId | filter | eq | | + * </br>| operationId | filter | eq | | </br>| callCountSuccess | select | | | </br>| + * callCountBlocked | select | | | </br>| callCountFailed | select | | | </br>| callCountOther | + * select | | | </br>| bandwidth | select, orderBy | | | </br>| cacheHitsCount | select | | | + * </br>| cacheMissCount | select | | | </br>| apiTimeAvg | select | | | </br>| apiTimeMin | + * select | | | </br>| apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| + * serviceTimeMin | select | | | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByGeo( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listBySubscription(String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| displayName | select, orderBy | | | </br>| apiRegion | filter | eq | | </br>| + * userId | select, filter | eq | | </br>| productId | select, filter | eq | | </br>| subscriptionId + * | select, filter | eq | | </br>| callCountSuccess | select, orderBy | | | </br>| callCountBlocked + * | select, orderBy | | | </br>| callCountFailed | select, orderBy | | | </br>| callCountOther | + * select, orderBy | | | </br>| callCountTotal | select, orderBy | | | </br>| bandwidth | select, + * orderBy | | | </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | + * </br>| apiTimeAvg | select, orderBy | | | </br>| apiTimeMin | select | | | </br>| + * apiTimeMax | select | | | </br>| serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | + * | </br>| serviceTimeMax | select | | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listBySubscription( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByTime( + String resourceGroupName, String serviceName, String filter, Duration interval); + + /** + * Lists report records by Time. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter, select + * | ge, le | | </br>| interval | select | | | </br>| apiRegion | filter | eq | | </br>| + * userId | filter | eq | | </br>| productId | filter | eq | | </br>| subscriptionId | filter | eq | + * | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| + * callCountSuccess | select | | | </br>| callCountBlocked | select | | | </br>| callCountFailed | + * select | | | </br>| callCountOther | select | | | </br>| bandwidth | select, orderBy | | | + * </br>| cacheHitsCount | select | | | </br>| cacheMissCount | select | | | </br>| apiTimeAvg + * | select | | | </br>| apiTimeMin | select | | | </br>| apiTimeMax | select | | | </br>| + * serviceTimeAvg | select | | | </br>| serviceTimeMin | select | | | </br>| serviceTimeMax | select + * | | | </br>. + * @param interval By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should + * be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert + * TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param orderby OData order by query option. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByTime( + String resourceGroupName, + String serviceName, + String filter, + Duration interval, + Integer top, + Integer skip, + String orderby, + Context context); + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter); + + /** + * Lists report records by Request. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| timestamp | filter | ge, le + * | | </br>| apiId | filter | eq | | </br>| operationId | filter | eq | | </br>| productId | + * filter | eq | | </br>| userId | filter | eq | | </br>| apiRegion | filter | eq | | </br>| + * subscriptionId | filter | eq | | </br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Report records list representation. + */ + PagedIterable listByRequest( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RepresentationContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RepresentationContract.java new file mode 100644 index 0000000000000..3c51f4395ccca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RepresentationContract.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Operation request/response representation details. */ +@Fluent +public final class RepresentationContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RepresentationContract.class); + + /* + * Specifies a registered or custom content type for this representation, + * e.g. application/xml. + */ + @JsonProperty(value = "contentType", required = true) + private String contentType; + + /* + * An example of the representation. + */ + @JsonProperty(value = "sample") + private String sample; + + /* + * Schema identifier. Applicable only if 'contentType' value is neither + * 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + */ + @JsonProperty(value = "schemaId") + private String schemaId; + + /* + * Type name defined by the schema. Applicable only if 'contentType' value + * is neither 'application/x-www-form-urlencoded' nor + * 'multipart/form-data'. + */ + @JsonProperty(value = "typeName") + private String typeName; + + /* + * Collection of form parameters. Required if 'contentType' value is either + * 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + */ + @JsonProperty(value = "formParameters") + private List formParameters; + + /** + * Get the contentType property: Specifies a registered or custom content type for this representation, e.g. + * application/xml. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Specifies a registered or custom content type for this representation, e.g. + * application/xml. + * + * @param contentType the contentType value to set. + * @return the RepresentationContract object itself. + */ + public RepresentationContract withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the sample property: An example of the representation. + * + * @return the sample value. + */ + public String sample() { + return this.sample; + } + + /** + * Set the sample property: An example of the representation. + * + * @param sample the sample value to set. + * @return the RepresentationContract object itself. + */ + public RepresentationContract withSample(String sample) { + this.sample = sample; + return this; + } + + /** + * Get the schemaId property: Schema identifier. Applicable only if 'contentType' value is neither + * 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + * + * @return the schemaId value. + */ + public String schemaId() { + return this.schemaId; + } + + /** + * Set the schemaId property: Schema identifier. Applicable only if 'contentType' value is neither + * 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + * + * @param schemaId the schemaId value to set. + * @return the RepresentationContract object itself. + */ + public RepresentationContract withSchemaId(String schemaId) { + this.schemaId = schemaId; + return this; + } + + /** + * Get the typeName property: Type name defined by the schema. Applicable only if 'contentType' value is neither + * 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + * + * @return the typeName value. + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName property: Type name defined by the schema. Applicable only if 'contentType' value is neither + * 'application/x-www-form-urlencoded' nor 'multipart/form-data'. + * + * @param typeName the typeName value to set. + * @return the RepresentationContract object itself. + */ + public RepresentationContract withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get the formParameters property: Collection of form parameters. Required if 'contentType' value is either + * 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + * + * @return the formParameters value. + */ + public List formParameters() { + return this.formParameters; + } + + /** + * Set the formParameters property: Collection of form parameters. Required if 'contentType' value is either + * 'application/x-www-form-urlencoded' or 'multipart/form-data'.. + * + * @param formParameters the formParameters value to set. + * @return the RepresentationContract object itself. + */ + public RepresentationContract withFormParameters(List formParameters) { + this.formParameters = formParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contentType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contentType in model RepresentationContract")); + } + if (formParameters() != null) { + formParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestContract.java new file mode 100644 index 0000000000000..5aa4711b02b3a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestContract.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Operation request details. */ +@Fluent +public final class RequestContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestContract.class); + + /* + * Operation request description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Collection of operation request query parameters. + */ + @JsonProperty(value = "queryParameters") + private List queryParameters; + + /* + * Collection of operation request headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /* + * Collection of operation request representations. + */ + @JsonProperty(value = "representations") + private List representations; + + /** + * Get the description property: Operation request description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Operation request description. + * + * @param description the description value to set. + * @return the RequestContract object itself. + */ + public RequestContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the queryParameters property: Collection of operation request query parameters. + * + * @return the queryParameters value. + */ + public List queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: Collection of operation request query parameters. + * + * @param queryParameters the queryParameters value to set. + * @return the RequestContract object itself. + */ + public RequestContract withQueryParameters(List queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the headers property: Collection of operation request headers. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: Collection of operation request headers. + * + * @param headers the headers value to set. + * @return the RequestContract object itself. + */ + public RequestContract withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the representations property: Collection of operation request representations. + * + * @return the representations value. + */ + public List representations() { + return this.representations; + } + + /** + * Set the representations property: Collection of operation request representations. + * + * @param representations the representations value to set. + * @return the RequestContract object itself. + */ + public RequestContract withRepresentations(List representations) { + this.representations = representations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryParameters() != null) { + queryParameters().forEach(e -> e.validate()); + } + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + if (representations() != null) { + representations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportCollection.java new file mode 100644 index 0000000000000..8c5e138ccd994 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Report records list representation. */ +@Fluent +public final class RequestReportCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequestReportCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the RequestReportCollection object itself. + */ + public RequestReportCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the RequestReportCollection object itself. + */ + public RequestReportCollection withCount(Long count) { + this.count = count; + 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportRecordContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportRecordContract.java new file mode 100644 index 0000000000000..6c109ed0199eb --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/RequestReportRecordContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RequestReportRecordContract. */ +public interface RequestReportRecordContract { + /** + * Gets the apiId property: API identifier path. /apis/{apiId}. + * + * @return the apiId value. + */ + String apiId(); + + /** + * Gets the operationId property: Operation identifier path. /apis/{apiId}/operations/{operationId}. + * + * @return the operationId value. + */ + String operationId(); + + /** + * Gets the productId property: Product identifier path. /products/{productId}. + * + * @return the productId value. + */ + String productId(); + + /** + * Gets the userId property: User identifier path. /users/{userId}. + * + * @return the userId value. + */ + String userId(); + + /** + * Gets the method property: The HTTP method associated with this request.. + * + * @return the method value. + */ + String method(); + + /** + * Gets the url property: The full URL associated with this request. + * + * @return the url value. + */ + String url(); + + /** + * Gets the ipAddress property: The client IP address associated with this request. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the backendResponseCode property: The HTTP status code received by the gateway as a result of forwarding + * this request to the backend. + * + * @return the backendResponseCode value. + */ + String backendResponseCode(); + + /** + * Gets the responseCode property: The HTTP status code returned by the gateway. + * + * @return the responseCode value. + */ + Integer responseCode(); + + /** + * Gets the responseSize property: The size of the response returned by the gateway. + * + * @return the responseSize value. + */ + Integer responseSize(); + + /** + * Gets the timestamp property: The date and time when this request was received by the gateway in ISO 8601 format. + * + * @return the timestamp value. + */ + OffsetDateTime timestamp(); + + /** + * Gets the cache property: Specifies if response cache was involved in generating the response. If the value is + * none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache + * was used but lookup resulted in a miss and request was fulfilled by the backend. + * + * @return the cache value. + */ + String cache(); + + /** + * Gets the apiTime property: The total time it took to process this request. + * + * @return the apiTime value. + */ + Double apiTime(); + + /** + * Gets the serviceTime property: he time it took to forward this request to the backend and get the response back. + * + * @return the serviceTime value. + */ + Double serviceTime(); + + /** + * Gets the apiRegion property: Azure region where the gateway that processed this request is located. + * + * @return the apiRegion value. + */ + String apiRegion(); + + /** + * Gets the subscriptionId property: Subscription identifier path. /subscriptions/{subscriptionId}. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the requestId property: Request Identifier. + * + * @return the requestId value. + */ + String requestId(); + + /** + * Gets the requestSize property: The size of this request.. + * + * @return the requestSize value. + */ + Integer requestSize(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.RequestReportRecordContractInner object. + * + * @return the inner object. + */ + RequestReportRecordContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceLocationDataContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceLocationDataContract.java new file mode 100644 index 0000000000000..330ed56b1c954 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceLocationDataContract.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Resource location data properties. */ +@Fluent +public final class ResourceLocationDataContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceLocationDataContract.class); + + /* + * A canonical name for the geographic or physical location. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The city or locality where the resource is located. + */ + @JsonProperty(value = "city") + private String city; + + /* + * The district, state, or province where the resource is located. + */ + @JsonProperty(value = "district") + private String district; + + /* + * The country or region where the resource is located. + */ + @JsonProperty(value = "countryOrRegion") + private String countryOrRegion; + + /** + * Get the name property: A canonical name for the geographic or physical location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A canonical name for the geographic or physical location. + * + * @param name the name value to set. + * @return the ResourceLocationDataContract object itself. + */ + public ResourceLocationDataContract withName(String name) { + this.name = name; + return this; + } + + /** + * Get the city property: The city or locality where the resource is located. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The city or locality where the resource is located. + * + * @param city the city value to set. + * @return the ResourceLocationDataContract object itself. + */ + public ResourceLocationDataContract withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the district property: The district, state, or province where the resource is located. + * + * @return the district value. + */ + public String district() { + return this.district; + } + + /** + * Set the district property: The district, state, or province where the resource is located. + * + * @param district the district value to set. + * @return the ResourceLocationDataContract object itself. + */ + public ResourceLocationDataContract withDistrict(String district) { + this.district = district; + return this; + } + + /** + * Get the countryOrRegion property: The country or region where the resource is located. + * + * @return the countryOrRegion value. + */ + public String countryOrRegion() { + return this.countryOrRegion; + } + + /** + * Set the countryOrRegion property: The country or region where the resource is located. + * + * @param countryOrRegion the countryOrRegion value to set. + * @return the ResourceLocationDataContract object itself. + */ + public ResourceLocationDataContract withCountryOrRegion(String countryOrRegion) { + this.countryOrRegion = countryOrRegion; + 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 ResourceLocationDataContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSku.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSku.java new file mode 100644 index 0000000000000..0d3e3dc7dd121 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSku.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an available API Management SKU. */ +@Fluent +public final class ResourceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSku.class); + + /* + * Name of the Sku. + */ + @JsonProperty(value = "name") + private SkuType name; + + /** + * Get the name property: Name of the Sku. + * + * @return the name value. + */ + public SkuType name() { + return this.name; + } + + /** + * Set the name property: Name of the Sku. + * + * @param name the name value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withName(SkuType 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacity.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacity.java new file mode 100644 index 0000000000000..1d118b0def9c4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacity.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 scaling information of a SKU. */ +@Immutable +public final class ResourceSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapacity.class); + + /* + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Integer minimum; + + /* + * The maximum capacity that can be set. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Integer maximum; + + /* + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Integer defaultProperty; + + /* + * The scale type applicable to the sku. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacityScaleType scaleType; + + /** + * Get the minimum property: The minimum capacity. + * + * @return the minimum value. + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Get the maximum property: The maximum capacity that can be set. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Get the defaultProperty property: The default capacity. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scaleType property: The scale type applicable to the sku. + * + * @return the scaleType value. + */ + public ResourceSkuCapacityScaleType scaleType() { + return this.scaleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacityScaleType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacityScaleType.java new file mode 100644 index 0000000000000..ce41e49e25138 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuCapacityScaleType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuCapacityScaleType. */ +public final class ResourceSkuCapacityScaleType extends ExpandableStringEnum { + /** Static value automatic for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType AUTOMATIC = fromString("automatic"); + + /** Static value manual for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType MANUAL = fromString("manual"); + + /** Static value none for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType NONE = fromString("none"); + + /** + * Creates or finds a ResourceSkuCapacityScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuCapacityScaleType. + */ + @JsonCreator + public static ResourceSkuCapacityScaleType fromString(String name) { + return fromString(name, ResourceSkuCapacityScaleType.class); + } + + /** @return known ResourceSkuCapacityScaleType values. */ + public static Collection values() { + return values(ResourceSkuCapacityScaleType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResult.java new file mode 100644 index 0000000000000..f55186b4f934b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResult.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.ResourceSkuResultInner; + +/** An immutable client-side representation of ResourceSkuResult. */ +public interface ResourceSkuResult { + /** + * Gets the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the sku property: Specifies API Management SKU. + * + * @return the sku value. + */ + ResourceSku sku(); + + /** + * Gets the capacity property: Specifies the number of API Management units. + * + * @return the capacity value. + */ + ResourceSkuCapacity capacity(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.ResourceSkuResultInner object. + * + * @return the inner object. + */ + ResourceSkuResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResults.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResults.java new file mode 100644 index 0000000000000..1fa03189e4d05 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResourceSkuResults.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.ResourceSkuResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The API Management service SKUs operation response. */ +@Fluent +public final class ResourceSkuResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuResults.class); + + /* + * The list of skus available for the service. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of API Management service Skus. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of skus available for the service. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of skus available for the service. + * + * @param value the value value to set. + * @return the ResourceSkuResults object itself. + */ + public ResourceSkuResults withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of API Management service Skus. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of API Management service Skus. + * + * @param nextLink the nextLink value to set. + * @return the ResourceSkuResults object itself. + */ + public ResourceSkuResults 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) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ResourceSkuResults")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResponseContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResponseContract.java new file mode 100644 index 0000000000000..58f546d4643dd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/ResponseContract.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Operation response details. */ +@Fluent +public final class ResponseContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResponseContract.class); + + /* + * Operation response HTTP status code. + */ + @JsonProperty(value = "statusCode", required = true) + private int statusCode; + + /* + * Operation response description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Collection of operation response representations. + */ + @JsonProperty(value = "representations") + private List representations; + + /* + * Collection of operation response headers. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Get the statusCode property: Operation response HTTP status code. + * + * @return the statusCode value. + */ + public int statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: Operation response HTTP status code. + * + * @param statusCode the statusCode value to set. + * @return the ResponseContract object itself. + */ + public ResponseContract withStatusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the description property: Operation response description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Operation response description. + * + * @param description the description value to set. + * @return the ResponseContract object itself. + */ + public ResponseContract withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the representations property: Collection of operation response representations. + * + * @return the representations value. + */ + public List representations() { + return this.representations; + } + + /** + * Set the representations property: Collection of operation response representations. + * + * @param representations the representations value to set. + * @return the ResponseContract object itself. + */ + public ResponseContract withRepresentations(List representations) { + this.representations = representations; + return this; + } + + /** + * Get the headers property: Collection of operation response headers. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: Collection of operation response headers. + * + * @param headers the headers value to set. + * @return the ResponseContract object itself. + */ + public ResponseContract withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (representations() != null) { + representations().forEach(e -> e.validate()); + } + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingSettings.java new file mode 100644 index 0000000000000..e450bb9a5ee35 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingSettings.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.apimanagement.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; + +/** Sampling settings for Diagnostic. */ +@Fluent +public final class SamplingSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SamplingSettings.class); + + /* + * Sampling type. + */ + @JsonProperty(value = "samplingType") + private SamplingType samplingType; + + /* + * Rate of sampling for fixed-rate sampling. + */ + @JsonProperty(value = "percentage") + private Double percentage; + + /** + * Get the samplingType property: Sampling type. + * + * @return the samplingType value. + */ + public SamplingType samplingType() { + return this.samplingType; + } + + /** + * Set the samplingType property: Sampling type. + * + * @param samplingType the samplingType value to set. + * @return the SamplingSettings object itself. + */ + public SamplingSettings withSamplingType(SamplingType samplingType) { + this.samplingType = samplingType; + return this; + } + + /** + * Get the percentage property: Rate of sampling for fixed-rate sampling. + * + * @return the percentage value. + */ + public Double percentage() { + return this.percentage; + } + + /** + * Set the percentage property: Rate of sampling for fixed-rate sampling. + * + * @param percentage the percentage value to set. + * @return the SamplingSettings object itself. + */ + public SamplingSettings withPercentage(Double percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingType.java new file mode 100644 index 0000000000000..d5e540163fd88 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SamplingType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SamplingType. */ +public final class SamplingType extends ExpandableStringEnum { + /** Static value fixed for SamplingType. */ + public static final SamplingType FIXED = fromString("fixed"); + + /** + * Creates or finds a SamplingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SamplingType. + */ + @JsonCreator + public static SamplingType fromString(String name) { + return fromString(name, SamplingType.class); + } + + /** @return known SamplingType values. */ + public static Collection values() { + return values(SamplingType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SaveConfigurationParameter.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SaveConfigurationParameter.java new file mode 100644 index 0000000000000..c245b9b8f9fe6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SaveConfigurationParameter.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.apimanagement.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; + +/** Save Tenant Configuration Contract details. */ +@JsonFlatten +@Fluent +public class SaveConfigurationParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SaveConfigurationParameter.class); + + /* + * The name of the Git branch in which to commit the current configuration + * snapshot. + */ + @JsonProperty(value = "properties.branch") + private String branch; + + /* + * The value if true, the current configuration database is committed to + * the Git repository, even if the Git repository has newer changes that + * would be overwritten. + */ + @JsonProperty(value = "properties.force") + private Boolean force; + + /** + * Get the branch property: The name of the Git branch in which to commit the current configuration snapshot. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The name of the Git branch in which to commit the current configuration snapshot. + * + * @param branch the branch value to set. + * @return the SaveConfigurationParameter object itself. + */ + public SaveConfigurationParameter withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the force property: The value if true, the current configuration database is committed to the Git repository, + * even if the Git repository has newer changes that would be overwritten. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: The value if true, the current configuration database is committed to the Git repository, + * even if the Git repository has newer changes that would be overwritten. + * + * @param force the force value to set. + * @return the SaveConfigurationParameter object itself. + */ + public SaveConfigurationParameter withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaCollection.java new file mode 100644 index 0000000000000..54ee33d5b63db --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of the list schema operation. */ +@Fluent +public final class SchemaCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaCollection.class); + + /* + * Api Schema Contract value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Total record count number. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Api Schema Contract value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the count property: Total record count number. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number. + * + * @param count the count value to set. + * @return the SchemaCollection object itself. + */ + public SchemaCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaContract.java new file mode 100644 index 0000000000000..f8a073ba1c465 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SchemaContract.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner; + +/** An immutable client-side representation of SchemaContract. */ +public interface SchemaContract { + /** + * 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 contentType property: Must be a valid a media type used in a Content-Type header as defined in the RFC + * 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema + * use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use + * `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`. + * + * @return the contentType value. + */ + String contentType(); + + /** + * Gets the value property: Json escaped string defining the document representing the Schema. Used for schemas + * other than Swagger/OpenAPI. + * + * @return the value value. + */ + String value(); + + /** + * Gets the definitions property: Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + * + * @return the definitions value. + */ + Object definitions(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.SchemaContractInner object. + * + * @return the inner object. + */ + SchemaContractInner innerModel(); + + /** The entirety of the SchemaContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SchemaContract definition stages. */ + interface DefinitionStages { + /** The first stage of the SchemaContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SchemaContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. + * Non-current revision has ;rev=n as a suffix where n is the revision number. + * @return the next definition stage. + */ + WithCreate withExistingApi(String resourceGroupName, String serviceName, String apiId); + } + /** + * The stage of the SchemaContract 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.WithContentType, + DefinitionStages.WithValue, + DefinitionStages.WithDefinitions, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + SchemaContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SchemaContract create(Context context); + } + /** The stage of the SchemaContract definition allowing to specify contentType. */ + interface WithContentType { + /** + * Specifies the contentType property: Must be a valid a media type used in a Content-Type header as defined + * in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> + * - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` + * Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`.. + * + * @param contentType Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. + * Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` + * Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use + * `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`. + * @return the next definition stage. + */ + WithCreate withContentType(String contentType); + } + /** The stage of the SchemaContract definition allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Json escaped string defining the document representing the Schema. Used for + * schemas other than Swagger/OpenAPI.. + * + * @param value Json escaped string defining the document representing the Schema. Used for schemas other + * than Swagger/OpenAPI. + * @return the next definition stage. + */ + WithCreate withValue(String value); + } + /** The stage of the SchemaContract definition allowing to specify definitions. */ + interface WithDefinitions { + /** + * Specifies the definitions property: Types definitions. Used for Swagger/OpenAPI schemas only, null + * otherwise.. + * + * @param definitions Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + * @return the next definition stage. + */ + WithCreate withDefinitions(Object definitions); + } + /** The stage of the SchemaContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the SchemaContract resource. + * + * @return the stage of resource update. + */ + SchemaContract.Update update(); + + /** The template for SchemaContract update. */ + interface Update + extends UpdateStages.WithContentType, + UpdateStages.WithValue, + UpdateStages.WithDefinitions, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SchemaContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SchemaContract apply(Context context); + } + /** The SchemaContract update stages. */ + interface UpdateStages { + /** The stage of the SchemaContract update allowing to specify contentType. */ + interface WithContentType { + /** + * Specifies the contentType property: Must be a valid a media type used in a Content-Type header as defined + * in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> + * - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` + * Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`.. + * + * @param contentType Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. + * Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` + * Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use + * `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use + * `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use + * `application/vnd.ms-azure-apim.wadl.grammars+xml`. + * @return the next definition stage. + */ + Update withContentType(String contentType); + } + /** The stage of the SchemaContract update allowing to specify value. */ + interface WithValue { + /** + * Specifies the value property: Json escaped string defining the document representing the Schema. Used for + * schemas other than Swagger/OpenAPI.. + * + * @param value Json escaped string defining the document representing the Schema. Used for schemas other + * than Swagger/OpenAPI. + * @return the next definition stage. + */ + Update withValue(String value); + } + /** The stage of the SchemaContract update allowing to specify definitions. */ + interface WithDefinitions { + /** + * Specifies the definitions property: Types definitions. Used for Swagger/OpenAPI schemas only, null + * otherwise.. + * + * @param definitions Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + * @return the next definition stage. + */ + Update withDefinitions(Object definitions); + } + /** The stage of the SchemaContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SchemaContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SchemaContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SettingsTypeName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SettingsTypeName.java new file mode 100644 index 0000000000000..a2de6687af424 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SettingsTypeName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SettingsTypeName. */ +public final class SettingsTypeName extends ExpandableStringEnum { + /** Static value public for SettingsTypeName. */ + public static final SettingsTypeName PUBLIC = fromString("public"); + + /** + * Creates or finds a SettingsTypeName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingsTypeName. + */ + @JsonCreator + public static SettingsTypeName fromString(String name) { + return fromString(name, SettingsTypeName.class); + } + + /** @return known SettingsTypeName values. */ + public static Collection values() { + return values(SettingsTypeName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettings.java new file mode 100644 index 0000000000000..cf5c92488cccc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettings.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; + +/** Resource collection API of SignInSettings. */ +public interface SignInSettings { + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName); + + /** + * Gets the entity state (Etag) version of the SignInSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignInSettings. + */ + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + PortalSigninSettings get(String resourceGroupName, String serviceName); + + /** + * Get Sign In Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign In Settings for the Portal. + */ + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String serviceName, String ifMatch, PortalSigninSettingsInner parameters); + + /** + * Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-In settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSigninSettingsInner parameters, + Context context); + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + PortalSigninSettings createOrUpdate( + String resourceGroupName, String serviceName, PortalSigninSettingsInner parameters); + + /** + * Create or Update Sign-In settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-In settings for the Developer Portal. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSigninSettingsInner parameters, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..c0847cc44bbfd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagHeaders.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.apimanagement.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 SignInSettingsGetEntityTagHeaders model. */ +@Fluent +public final class SignInSettingsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignInSettingsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SignInSettingsGetEntityTagHeaders object itself. + */ + public SignInSettingsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagResponse.java new file mode 100644 index 0000000000000..c3d9862a62621 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class SignInSettingsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of SignInSettingsGetEntityTagResponse. + * + * @param request the request which resulted in this SignInSettingsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SignInSettingsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + SignInSettingsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetHeaders.java new file mode 100644 index 0000000000000..2eaafb55d7d97 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetHeaders.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.apimanagement.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 SignInSettingsGetHeaders model. */ +@Fluent +public final class SignInSettingsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignInSettingsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SignInSettingsGetHeaders object itself. + */ + public SignInSettingsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetResponse.java new file mode 100644 index 0000000000000..06a248bf924cd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignInSettingsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSigninSettingsInner; + +/** Contains all response data for the get operation. */ +public final class SignInSettingsGetResponse extends ResponseBase { + /** + * Creates an instance of SignInSettingsGetResponse. + * + * @param request the request which resulted in this SignInSettingsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SignInSettingsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PortalSigninSettingsInner value, + SignInSettingsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PortalSigninSettingsInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettings.java new file mode 100644 index 0000000000000..e1602a22366b4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettings.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner; + +/** Resource collection API of SignUpSettings. */ +public interface SignUpSettings { + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName); + + /** + * Gets the entity state (Etag) version of the SignUpSettings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the SignUpSettings. + */ + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + PortalSignupSettings get(String resourceGroupName, String serviceName); + + /** + * Get Sign Up Settings for the Portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign Up Settings for the Portal. + */ + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String serviceName, String ifMatch, PortalSignupSettingsInner parameters); + + /** + * Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update Sign-Up settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String ifMatch, + PortalSignupSettingsInner parameters, + Context context); + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + PortalSignupSettings createOrUpdate( + String resourceGroupName, String serviceName, PortalSignupSettingsInner parameters); + + /** + * Create or Update Sign-Up settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param parameters Create or update parameters. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sign-Up settings for a developer portal. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + PortalSignupSettingsInner parameters, + String ifMatch, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..aee95e66bdb2c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagHeaders.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.apimanagement.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 SignUpSettingsGetEntityTagHeaders model. */ +@Fluent +public final class SignUpSettingsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignUpSettingsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SignUpSettingsGetEntityTagHeaders object itself. + */ + public SignUpSettingsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagResponse.java new file mode 100644 index 0000000000000..5804d743972ee --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class SignUpSettingsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of SignUpSettingsGetEntityTagResponse. + * + * @param request the request which resulted in this SignUpSettingsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SignUpSettingsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + SignUpSettingsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetHeaders.java new file mode 100644 index 0000000000000..a33a03fe081ca --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetHeaders.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.apimanagement.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 SignUpSettingsGetHeaders model. */ +@Fluent +public final class SignUpSettingsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignUpSettingsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SignUpSettingsGetHeaders object itself. + */ + public SignUpSettingsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetResponse.java new file mode 100644 index 0000000000000..7f67230b91bf3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SignUpSettingsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.PortalSignupSettingsInner; + +/** Contains all response data for the get operation. */ +public final class SignUpSettingsGetResponse extends ResponseBase { + /** + * Creates an instance of SignUpSettingsGetResponse. + * + * @param request the request which resulted in this SignUpSettingsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SignUpSettingsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PortalSignupSettingsInner value, + SignUpSettingsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PortalSignupSettingsInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SkuType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SkuType.java new file mode 100644 index 0000000000000..24ad7a87c52b3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SkuType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuType. */ +public final class SkuType extends ExpandableStringEnum { + /** Static value Developer for SkuType. */ + public static final SkuType DEVELOPER = fromString("Developer"); + + /** Static value Standard for SkuType. */ + public static final SkuType STANDARD = fromString("Standard"); + + /** Static value Premium for SkuType. */ + public static final SkuType PREMIUM = fromString("Premium"); + + /** Static value Basic for SkuType. */ + public static final SkuType BASIC = fromString("Basic"); + + /** Static value Consumption for SkuType. */ + public static final SkuType CONSUMPTION = fromString("Consumption"); + + /** Static value Isolated for SkuType. */ + public static final SkuType ISOLATED = fromString("Isolated"); + + /** + * Creates or finds a SkuType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuType. + */ + @JsonCreator + public static SkuType fromString(String name) { + return fromString(name, SkuType.class); + } + + /** @return known SkuType values. */ + public static Collection values() { + return values(SkuType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SoapApiType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SoapApiType.java new file mode 100644 index 0000000000000..8686e6e0646a9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SoapApiType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SoapApiType. */ +public final class SoapApiType extends ExpandableStringEnum { + /** Static value http for SoapApiType. */ + public static final SoapApiType HTTP = fromString("http"); + + /** Static value soap for SoapApiType. */ + public static final SoapApiType SOAP = fromString("soap"); + + /** + * Creates or finds a SoapApiType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SoapApiType. + */ + @JsonCreator + public static SoapApiType fromString(String name) { + return fromString(name, SoapApiType.class); + } + + /** @return known SoapApiType values. */ + public static Collection values() { + return values(SoapApiType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/State.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/State.java new file mode 100644 index 0000000000000..82e3cce286a51 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/State.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.apimanagement.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 proposed for State. */ + public static final State PROPOSED = fromString("proposed"); + + /** Static value open for State. */ + public static final State OPEN = fromString("open"); + + /** Static value removed for State. */ + public static final State REMOVED = fromString("removed"); + + /** Static value resolved for State. */ + public static final State RESOLVED = fromString("resolved"); + + /** Static value closed for State. */ + public static final State CLOSED = fromString("closed"); + + /** + * 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCollection.java new file mode 100644 index 0000000000000..26d742433ddc5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Subscriptions list representation. */ +@Fluent +public final class SubscriptionCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the SubscriptionCollection object itself. + */ + public SubscriptionCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the SubscriptionCollection object itself. + */ + public SubscriptionCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the SubscriptionCollection object itself. + */ + public SubscriptionCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionContract.java new file mode 100644 index 0000000000000..70b61dc16dc89 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SubscriptionContract. */ +public interface SubscriptionContract { + /** + * 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 ownerId property: The user resource identifier of the subscription owner. The value is a valid relative + * URL in the format of /users/{userId} where {userId} is a user identifier. + * + * @return the ownerId value. + */ + String ownerId(); + + /** + * Gets the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the displayName property: The name of the subscription, or null if the subscription has no name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the state property: Subscription state. Possible states are * active – the subscription is active, * + * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – + * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – + * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled + * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + * + * @return the state value. + */ + SubscriptionState state(); + + /** + * Gets the createdDate property: Subscription creation date. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the createdDate value. + */ + OffsetDateTime createdDate(); + + /** + * Gets the startDate property: Subscription activation date. The setting is for audit purposes only and the + * subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the startDate value. + */ + OffsetDateTime startDate(); + + /** + * Gets the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the + * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the expirationDate value. + */ + OffsetDateTime expirationDate(); + + /** + * Gets the endDate property: Date when subscription was cancelled or expired. The setting is for audit purposes + * only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the + * `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the endDate value. + */ + OffsetDateTime endDate(); + + /** + * Gets the notificationDate property: Upcoming subscription expiration notification date. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the notificationDate value. + */ + OffsetDateTime notificationDate(); + + /** + * Gets the primaryKey property: Subscription primary key. This property will not be filled on 'GET' operations! Use + * '/listSecrets' POST request to get the value. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: Subscription secondary key. This property will not be filled on 'GET' operations! + * Use '/listSecrets' POST request to get the value. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the stateComment property: Optional subscription comment added by an administrator when the state is changed + * to the 'rejected'. + * + * @return the stateComment value. + */ + String stateComment(); + + /** + * Gets the allowTracing property: Determines whether tracing is enabled. + * + * @return the allowTracing value. + */ + Boolean allowTracing(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner object. + * + * @return the inner object. + */ + SubscriptionContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCreateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCreateParameters.java new file mode 100644 index 0000000000000..8e94492482fc9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionCreateParameters.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Subscription create details. */ +@JsonFlatten +@Fluent +public class SubscriptionCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionCreateParameters.class); + + /* + * User (user id path) for whom subscription is being created in form + * /users/{userId} + */ + @JsonProperty(value = "properties.ownerId") + private String ownerId; + + /* + * Scope like /products/{productId} or /apis or /apis/{apiId}. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /* + * Subscription name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Primary subscription key. If not specified during request key will be + * generated automatically. + */ + @JsonProperty(value = "properties.primaryKey") + private String primaryKey; + + /* + * Secondary subscription key. If not specified during request key will be + * generated automatically. + */ + @JsonProperty(value = "properties.secondaryKey") + private String secondaryKey; + + /* + * Initial subscription state. If no value is specified, subscription is + * created with Submitted state. Possible states are * active – the + * subscription is active, * suspended – the subscription is blocked, and + * the subscriber cannot call any APIs of the product, * submitted – the + * subscription request has been made by the developer, but has not yet + * been approved or rejected, * rejected – the subscription request has + * been denied by an administrator, * cancelled – the subscription has been + * cancelled by the developer or administrator, * expired – the + * subscription reached its expiration date and was deactivated. + */ + @JsonProperty(value = "properties.state") + private SubscriptionState state; + + /* + * Determines whether tracing can be enabled + */ + @JsonProperty(value = "properties.allowTracing") + private Boolean allowTracing; + + /** + * Get the ownerId property: User (user id path) for whom subscription is being created in form /users/{userId}. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: User (user id path) for whom subscription is being created in form /users/{userId}. + * + * @param ownerId the ownerId value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @param scope the scope value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the displayName property: Subscription name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Subscription name. + * + * @param displayName the displayName value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the primaryKey property: Primary subscription key. If not specified during request key will be generated + * automatically. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary subscription key. If not specified during request key will be generated + * automatically. + * + * @param primaryKey the primaryKey value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary subscription key. If not specified during request key will be generated + * automatically. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary subscription key. If not specified during request key will be generated + * automatically. + * + * @param secondaryKey the secondaryKey value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the state property: Initial subscription state. If no value is specified, subscription is created with + * Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is + * blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been + * made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been + * denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, + * * expired – the subscription reached its expiration date and was deactivated. + * + * @return the state value. + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Set the state property: Initial subscription state. If no value is specified, subscription is created with + * Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is + * blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been + * made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been + * denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, + * * expired – the subscription reached its expiration date and was deactivated. + * + * @param state the state value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withState(SubscriptionState state) { + this.state = state; + return this; + } + + /** + * Get the allowTracing property: Determines whether tracing can be enabled. + * + * @return the allowTracing value. + */ + public Boolean allowTracing() { + return this.allowTracing; + } + + /** + * Set the allowTracing property: Determines whether tracing can be enabled. + * + * @param allowTracing the allowTracing value to set. + * @return the SubscriptionCreateParameters object itself. + */ + public SubscriptionCreateParameters withAllowTracing(Boolean allowTracing) { + this.allowTracing = allowTracing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeyParameterNamesContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeyParameterNamesContract.java new file mode 100644 index 0000000000000..71286e665f295 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeyParameterNamesContract.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.apimanagement.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; + +/** Subscription key parameter names details. */ +@Fluent +public final class SubscriptionKeyParameterNamesContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionKeyParameterNamesContract.class); + + /* + * Subscription key header name. + */ + @JsonProperty(value = "header") + private String headerProperty; + + /* + * Subscription key query string parameter name. + */ + @JsonProperty(value = "query") + private String query; + + /** + * Get the headerProperty property: Subscription key header name. + * + * @return the headerProperty value. + */ + public String headerProperty() { + return this.headerProperty; + } + + /** + * Set the headerProperty property: Subscription key header name. + * + * @param headerProperty the headerProperty value to set. + * @return the SubscriptionKeyParameterNamesContract object itself. + */ + public SubscriptionKeyParameterNamesContract withHeaderProperty(String headerProperty) { + this.headerProperty = headerProperty; + return this; + } + + /** + * Get the query property: Subscription key query string parameter name. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: Subscription key query string parameter name. + * + * @param query the query value to set. + * @return the SubscriptionKeyParameterNamesContract object itself. + */ + public SubscriptionKeyParameterNamesContract withQuery(String query) { + this.query = query; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeysContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeysContract.java new file mode 100644 index 0000000000000..02784343e2708 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionKeysContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner; + +/** An immutable client-side representation of SubscriptionKeysContract. */ +public interface SubscriptionKeysContract { + /** + * Gets the primaryKey property: Subscription primary key. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: Subscription secondary key. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner object. + * + * @return the inner object. + */ + SubscriptionKeysContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionState.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionState.java new file mode 100644 index 0000000000000..fdbe197384f87 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionState.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.apimanagement.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SubscriptionState. */ +public enum SubscriptionState { + /** Enum value suspended. */ + SUSPENDED("suspended"), + + /** Enum value active. */ + ACTIVE("active"), + + /** Enum value expired. */ + EXPIRED("expired"), + + /** Enum value submitted. */ + SUBMITTED("submitted"), + + /** Enum value rejected. */ + REJECTED("rejected"), + + /** Enum value cancelled. */ + CANCELLED("cancelled"); + + /** The actual serialized value for a SubscriptionState instance. */ + private final String value; + + SubscriptionState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SubscriptionState instance. + * + * @param value the serialized value to parse. + * @return the parsed SubscriptionState object, or null if unable to parse. + */ + @JsonCreator + public static SubscriptionState fromString(String value) { + SubscriptionState[] items = SubscriptionState.values(); + for (SubscriptionState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionUpdateParameters.java new file mode 100644 index 0000000000000..ab74e9ee345c3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionUpdateParameters.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.apimanagement.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.time.OffsetDateTime; + +/** Subscription update details. */ +@JsonFlatten +@Fluent +public class SubscriptionUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionUpdateParameters.class); + + /* + * User identifier path: /users/{userId} + */ + @JsonProperty(value = "properties.ownerId") + private String ownerId; + + /* + * Scope like /products/{productId} or /apis or /apis/{apiId} + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /* + * Subscription expiration date. The setting is for audit purposes only and + * the subscription is not automatically expired. The subscription + * lifecycle can be managed by using the `state` property. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by + * the ISO 8601 standard. + */ + @JsonProperty(value = "properties.expirationDate") + private OffsetDateTime expirationDate; + + /* + * Subscription name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Primary subscription key. + */ + @JsonProperty(value = "properties.primaryKey") + private String primaryKey; + + /* + * Secondary subscription key. + */ + @JsonProperty(value = "properties.secondaryKey") + private String secondaryKey; + + /* + * Subscription state. Possible states are * active – the subscription is + * active, * suspended – the subscription is blocked, and the subscriber + * cannot call any APIs of the product, * submitted – the subscription + * request has been made by the developer, but has not yet been approved or + * rejected, * rejected – the subscription request has been denied by an + * administrator, * cancelled – the subscription has been cancelled by the + * developer or administrator, * expired – the subscription reached its + * expiration date and was deactivated. + */ + @JsonProperty(value = "properties.state") + private SubscriptionState state; + + /* + * Comments describing subscription state change by the administrator when + * the state is changed to the 'rejected'. + */ + @JsonProperty(value = "properties.stateComment") + private String stateComment; + + /* + * Determines whether tracing can be enabled + */ + @JsonProperty(value = "properties.allowTracing") + private Boolean allowTracing; + + /** + * Get the ownerId property: User identifier path: /users/{userId}. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: User identifier path: /users/{userId}. + * + * @param ownerId the ownerId value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}. + * + * @param scope the scope value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the + * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the + * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` + * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + * standard. + * + * @param expirationDate the expirationDate value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withExpirationDate(OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the displayName property: Subscription name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Subscription name. + * + * @param displayName the displayName value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the primaryKey property: Primary subscription key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary subscription key. + * + * @param primaryKey the primaryKey value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary subscription key. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary subscription key. + * + * @param secondaryKey the secondaryKey value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the state property: Subscription state. Possible states are * active – the subscription is active, * + * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – + * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – + * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled + * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + * + * @return the state value. + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Set the state property: Subscription state. Possible states are * active – the subscription is active, * + * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – + * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – + * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled + * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. + * + * @param state the state value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withState(SubscriptionState state) { + this.state = state; + return this; + } + + /** + * Get the stateComment property: Comments describing subscription state change by the administrator when the state + * is changed to the 'rejected'. + * + * @return the stateComment value. + */ + public String stateComment() { + return this.stateComment; + } + + /** + * Set the stateComment property: Comments describing subscription state change by the administrator when the state + * is changed to the 'rejected'. + * + * @param stateComment the stateComment value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withStateComment(String stateComment) { + this.stateComment = stateComment; + return this; + } + + /** + * Get the allowTracing property: Determines whether tracing can be enabled. + * + * @return the allowTracing value. + */ + public Boolean allowTracing() { + return this.allowTracing; + } + + /** + * Set the allowTracing property: Determines whether tracing can be enabled. + * + * @param allowTracing the allowTracing value to set. + * @return the SubscriptionUpdateParameters object itself. + */ + public SubscriptionUpdateParameters withAllowTracing(Boolean allowTracing) { + this.allowTracing = allowTracing; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Subscriptions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Subscriptions.java new file mode 100644 index 0000000000000..3d14658aa7e5e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Subscriptions.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Subscriptions. */ +public interface Subscriptions { + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Lists all subscriptions of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| stateComment | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| ownerId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| scope | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| userId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| productId | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| user | expand | + * | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String sid); + + /** + * Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the apimanagement subscription specified by its identifier. + */ + Response getEntityTagWithResponse(String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + SubscriptionContract get(String resourceGroupName, String serviceName, String sid); + + /** + * Gets the specified Subscription entity. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + SubscriptionContract createOrUpdate( + String resourceGroupName, String serviceName, String sid, SubscriptionCreateParameters parameters); + + /** + * Creates or updates the subscription of specified user to the specified product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param parameters Create parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an entity. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + SubscriptionCreateParameters parameters, + Boolean notify, + String ifMatch, + AppType appType, + Context context); + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + SubscriptionContract update( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters); + + /** + * Updates the details of a subscription specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param parameters Update parameters. + * @param notify Notify change in Subscription State. - If false, do not send any email notification for change of + * state of subscription - If true, send email notification of change of state of subscription. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription details. + */ + Response updateWithResponse( + String resourceGroupName, + String serviceName, + String sid, + String ifMatch, + SubscriptionUpdateParameters parameters, + Boolean notify, + AppType appType, + Context context); + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String sid, String ifMatch); + + /** + * Deletes the specified subscription. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String sid, String ifMatch, Context context); + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 regeneratePrimaryKey(String resourceGroupName, String serviceName, String sid); + + /** + * Regenerates primary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 regenerateSecondaryKey(String resourceGroupName, String serviceName, String sid); + + /** + * Regenerates secondary key of existing subscription of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + SubscriptionKeysContract listSecrets(String resourceGroupName, String serviceName, String sid); + + /** + * Gets the specified Subscription keys. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription keys. + */ + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, String sid, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..760e82aff9d21 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateHeaders.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.apimanagement.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 SubscriptionsCreateOrUpdateHeaders model. */ +@Fluent +public final class SubscriptionsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SubscriptionsCreateOrUpdateHeaders object itself. + */ + public SubscriptionsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..9eb2e042c93a3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class SubscriptionsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of SubscriptionsCreateOrUpdateResponse. + * + * @param request the request which resulted in this SubscriptionsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SubscriptionsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SubscriptionContractInner value, + SubscriptionsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SubscriptionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsDelegationSettingsProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsDelegationSettingsProperties.java new file mode 100644 index 0000000000000..f4bdfc89a52c9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsDelegationSettingsProperties.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.apimanagement.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; + +/** Subscriptions delegation settings properties. */ +@Fluent +public final class SubscriptionsDelegationSettingsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsDelegationSettingsProperties.class); + + /* + * Enable or disable delegation for subscriptions. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the enabled property: Enable or disable delegation for subscriptions. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable or disable delegation for subscriptions. + * + * @param enabled the enabled value to set. + * @return the SubscriptionsDelegationSettingsProperties object itself. + */ + public SubscriptionsDelegationSettingsProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagHeaders.java new file mode 100644 index 0000000000000..bff310b06f0ae --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagHeaders.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.apimanagement.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 SubscriptionsGetEntityTagHeaders model. */ +@Fluent +public final class SubscriptionsGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SubscriptionsGetEntityTagHeaders object itself. + */ + public SubscriptionsGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagResponse.java new file mode 100644 index 0000000000000..a3e96fdd74374 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class SubscriptionsGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of SubscriptionsGetEntityTagResponse. + * + * @param request the request which resulted in this SubscriptionsGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SubscriptionsGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + SubscriptionsGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetHeaders.java new file mode 100644 index 0000000000000..a33775d47ead2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetHeaders.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.apimanagement.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 SubscriptionsGetHeaders model. */ +@Fluent +public final class SubscriptionsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SubscriptionsGetHeaders object itself. + */ + public SubscriptionsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetResponse.java new file mode 100644 index 0000000000000..86fdfd8b28488 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; + +/** Contains all response data for the get operation. */ +public final class SubscriptionsGetResponse extends ResponseBase { + /** + * Creates an instance of SubscriptionsGetResponse. + * + * @param request the request which resulted in this SubscriptionsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SubscriptionsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SubscriptionContractInner value, + SubscriptionsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SubscriptionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsHeaders.java new file mode 100644 index 0000000000000..0282c518b09fd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsHeaders.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.apimanagement.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 SubscriptionsListSecretsHeaders model. */ +@Fluent +public final class SubscriptionsListSecretsHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsListSecretsHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SubscriptionsListSecretsHeaders object itself. + */ + public SubscriptionsListSecretsHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsResponse.java new file mode 100644 index 0000000000000..eb0b958185268 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsListSecretsResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionKeysContractInner; + +/** Contains all response data for the listSecrets operation. */ +public final class SubscriptionsListSecretsResponse + extends ResponseBase { + /** + * Creates an instance of SubscriptionsListSecretsResponse. + * + * @param request the request which resulted in this SubscriptionsListSecretsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SubscriptionsListSecretsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SubscriptionKeysContractInner value, + SubscriptionsListSecretsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SubscriptionKeysContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateHeaders.java new file mode 100644 index 0000000000000..030d7941ec185 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateHeaders.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.apimanagement.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 SubscriptionsUpdateHeaders model. */ +@Fluent +public final class SubscriptionsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SubscriptionsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the SubscriptionsUpdateHeaders object itself. + */ + public SubscriptionsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateResponse.java new file mode 100644 index 0000000000000..164d400c5d156 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/SubscriptionsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; + +/** Contains all response data for the update operation. */ +public final class SubscriptionsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of SubscriptionsUpdateResponse. + * + * @param request the request which resulted in this SubscriptionsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SubscriptionsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SubscriptionContractInner value, + SubscriptionsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SubscriptionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCollection.java new file mode 100644 index 0000000000000..3d890c2b7768b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Tag list representation. */ +@Fluent +public final class TagCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the TagCollection object itself. + */ + public TagCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the TagCollection object itself. + */ + public TagCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the TagCollection object itself. + */ + public TagCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagContract.java new file mode 100644 index 0000000000000..566abd32f4ebf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagContract.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** An immutable client-side representation of TagContract. */ +public interface TagContract { + /** + * 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 displayName property: Tag name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner object. + * + * @return the inner object. + */ + TagContractInner innerModel(); + + /** The entirety of the TagContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TagContract definition stages. */ + interface DefinitionStages { + /** The first stage of the TagContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TagContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the TagContract 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.WithDisplayName, DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + TagContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TagContract create(Context context); + } + /** The stage of the TagContract definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Tag name.. + * + * @param displayName Tag name. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the TagContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the TagContract resource. + * + * @return the stage of resource update. + */ + TagContract.Update update(); + + /** The template for TagContract update. */ + interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TagContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TagContract apply(Context context); + } + /** The TagContract update stages. */ + interface UpdateStages { + /** The stage of the TagContract update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Tag name.. + * + * @param displayName Tag name. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the TagContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TagContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TagContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCreateUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCreateUpdateParameters.java new file mode 100644 index 0000000000000..9720d3a89c7e5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagCreateUpdateParameters.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.apimanagement.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; + +/** Parameters supplied to Create/Update Tag operations. */ +@JsonFlatten +@Fluent +public class TagCreateUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagCreateUpdateParameters.class); + + /* + * Tag name. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get the displayName property: Tag name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Tag name. + * + * @param displayName the displayName value to set. + * @return the TagCreateUpdateParameters object itself. + */ + public TagCreateUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionBaseProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionBaseProperties.java new file mode 100644 index 0000000000000..d6059fcf476df --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionBaseProperties.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.apimanagement.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; + +/** Parameters supplied to the Create TagDescription operation. */ +@Fluent +public class TagDescriptionBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagDescriptionBaseProperties.class); + + /* + * Description of the Tag. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Absolute URL of external resources describing the tag. + */ + @JsonProperty(value = "externalDocsUrl") + private String externalDocsUrl; + + /* + * Description of the external resources describing the tag. + */ + @JsonProperty(value = "externalDocsDescription") + private String externalDocsDescription; + + /** + * Get the description property: Description of the Tag. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the Tag. + * + * @param description the description value to set. + * @return the TagDescriptionBaseProperties object itself. + */ + public TagDescriptionBaseProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @return the externalDocsUrl value. + */ + public String externalDocsUrl() { + return this.externalDocsUrl; + } + + /** + * Set the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @param externalDocsUrl the externalDocsUrl value to set. + * @return the TagDescriptionBaseProperties object itself. + */ + public TagDescriptionBaseProperties withExternalDocsUrl(String externalDocsUrl) { + this.externalDocsUrl = externalDocsUrl; + return this; + } + + /** + * Get the externalDocsDescription property: Description of the external resources describing the tag. + * + * @return the externalDocsDescription value. + */ + public String externalDocsDescription() { + return this.externalDocsDescription; + } + + /** + * Set the externalDocsDescription property: Description of the external resources describing the tag. + * + * @param externalDocsDescription the externalDocsDescription value to set. + * @return the TagDescriptionBaseProperties object itself. + */ + public TagDescriptionBaseProperties withExternalDocsDescription(String externalDocsDescription) { + this.externalDocsDescription = externalDocsDescription; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCollection.java new file mode 100644 index 0000000000000..d141a72b052ea --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged TagDescription list representation. */ +@Fluent +public final class TagDescriptionCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagDescriptionCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the TagDescriptionCollection object itself. + */ + public TagDescriptionCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the TagDescriptionCollection object itself. + */ + public TagDescriptionCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the TagDescriptionCollection object itself. + */ + public TagDescriptionCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContract.java new file mode 100644 index 0000000000000..7d5c60bff0f91 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContract.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner; + +/** An immutable client-side representation of TagDescriptionContract. */ +public interface TagDescriptionContract { + /** + * 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 description property: Description of the Tag. + * + * @return the description value. + */ + String description(); + + /** + * Gets the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @return the externalDocsUrl value. + */ + String externalDocsUrl(); + + /** + * Gets the externalDocsDescription property: Description of the external resources describing the tag. + * + * @return the externalDocsDescription value. + */ + String externalDocsDescription(); + + /** + * Gets the tagId property: Identifier of the tag in the form of /tags/{tagId}. + * + * @return the tagId value. + */ + String tagId(); + + /** + * Gets the displayName property: Tag name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.TagDescriptionContractInner object. + * + * @return the inner object. + */ + TagDescriptionContractInner innerModel(); + + /** The entirety of the TagDescriptionContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TagDescriptionContract definition stages. */ + interface DefinitionStages { + /** The first stage of the TagDescriptionContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TagDescriptionContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiId. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. + * Non-current revision has ;rev=n as a suffix where n is the revision number. + * @return the next definition stage. + */ + WithCreate withExistingApi(String resourceGroupName, String serviceName, String apiId); + } + /** + * The stage of the TagDescriptionContract 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.WithDescription, + DefinitionStages.WithExternalDocsUrl, + DefinitionStages.WithExternalDocsDescription, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + TagDescriptionContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TagDescriptionContract create(Context context); + } + /** The stage of the TagDescriptionContract definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the Tag.. + * + * @param description Description of the Tag. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the TagDescriptionContract definition allowing to specify externalDocsUrl. */ + interface WithExternalDocsUrl { + /** + * Specifies the externalDocsUrl property: Absolute URL of external resources describing the tag.. + * + * @param externalDocsUrl Absolute URL of external resources describing the tag. + * @return the next definition stage. + */ + WithCreate withExternalDocsUrl(String externalDocsUrl); + } + /** The stage of the TagDescriptionContract definition allowing to specify externalDocsDescription. */ + interface WithExternalDocsDescription { + /** + * Specifies the externalDocsDescription property: Description of the external resources describing the + * tag.. + * + * @param externalDocsDescription Description of the external resources describing the tag. + * @return the next definition stage. + */ + WithCreate withExternalDocsDescription(String externalDocsDescription); + } + /** The stage of the TagDescriptionContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the TagDescriptionContract resource. + * + * @return the stage of resource update. + */ + TagDescriptionContract.Update update(); + + /** The template for TagDescriptionContract update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithExternalDocsUrl, + UpdateStages.WithExternalDocsDescription, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TagDescriptionContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TagDescriptionContract apply(Context context); + } + /** The TagDescriptionContract update stages. */ + interface UpdateStages { + /** The stage of the TagDescriptionContract update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of the Tag.. + * + * @param description Description of the Tag. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the TagDescriptionContract update allowing to specify externalDocsUrl. */ + interface WithExternalDocsUrl { + /** + * Specifies the externalDocsUrl property: Absolute URL of external resources describing the tag.. + * + * @param externalDocsUrl Absolute URL of external resources describing the tag. + * @return the next definition stage. + */ + Update withExternalDocsUrl(String externalDocsUrl); + } + /** The stage of the TagDescriptionContract update allowing to specify externalDocsDescription. */ + interface WithExternalDocsDescription { + /** + * Specifies the externalDocsDescription property: Description of the external resources describing the + * tag.. + * + * @param externalDocsDescription Description of the external resources describing the tag. + * @return the next definition stage. + */ + Update withExternalDocsDescription(String externalDocsDescription); + } + /** The stage of the TagDescriptionContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TagDescriptionContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TagDescriptionContract refresh(Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContractProperties.java new file mode 100644 index 0000000000000..74b779a27bb9f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionContractProperties.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.apimanagement.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; + +/** TagDescription contract Properties. */ +@Fluent +public final class TagDescriptionContractProperties extends TagDescriptionBaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagDescriptionContractProperties.class); + + /* + * Identifier of the tag in the form of /tags/{tagId} + */ + @JsonProperty(value = "tagId") + private String tagId; + + /* + * Tag name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the tagId property: Identifier of the tag in the form of /tags/{tagId}. + * + * @return the tagId value. + */ + public String tagId() { + return this.tagId; + } + + /** + * Set the tagId property: Identifier of the tag in the form of /tags/{tagId}. + * + * @param tagId the tagId value to set. + * @return the TagDescriptionContractProperties object itself. + */ + public TagDescriptionContractProperties withTagId(String tagId) { + this.tagId = tagId; + return this; + } + + /** + * Get the displayName property: Tag name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Tag name. + * + * @param displayName the displayName value to set. + * @return the TagDescriptionContractProperties object itself. + */ + public TagDescriptionContractProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** {@inheritDoc} */ + @Override + public TagDescriptionContractProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public TagDescriptionContractProperties withExternalDocsUrl(String externalDocsUrl) { + super.withExternalDocsUrl(externalDocsUrl); + return this; + } + + /** {@inheritDoc} */ + @Override + public TagDescriptionContractProperties withExternalDocsDescription(String externalDocsDescription) { + super.withExternalDocsDescription(externalDocsDescription); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCreateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCreateParameters.java new file mode 100644 index 0000000000000..b6e943dc5f691 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagDescriptionCreateParameters.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.apimanagement.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; + +/** Parameters supplied to the Create TagDescription operation. */ +@JsonFlatten +@Fluent +public class TagDescriptionCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagDescriptionCreateParameters.class); + + /* + * Description of the Tag. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Absolute URL of external resources describing the tag. + */ + @JsonProperty(value = "properties.externalDocsUrl") + private String externalDocsUrl; + + /* + * Description of the external resources describing the tag. + */ + @JsonProperty(value = "properties.externalDocsDescription") + private String externalDocsDescription; + + /** + * Get the description property: Description of the Tag. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the Tag. + * + * @param description the description value to set. + * @return the TagDescriptionCreateParameters object itself. + */ + public TagDescriptionCreateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @return the externalDocsUrl value. + */ + public String externalDocsUrl() { + return this.externalDocsUrl; + } + + /** + * Set the externalDocsUrl property: Absolute URL of external resources describing the tag. + * + * @param externalDocsUrl the externalDocsUrl value to set. + * @return the TagDescriptionCreateParameters object itself. + */ + public TagDescriptionCreateParameters withExternalDocsUrl(String externalDocsUrl) { + this.externalDocsUrl = externalDocsUrl; + return this; + } + + /** + * Get the externalDocsDescription property: Description of the external resources describing the tag. + * + * @return the externalDocsDescription value. + */ + public String externalDocsDescription() { + return this.externalDocsDescription; + } + + /** + * Set the externalDocsDescription property: Description of the external resources describing the tag. + * + * @param externalDocsDescription the externalDocsDescription value to set. + * @return the TagDescriptionCreateParameters object itself. + */ + public TagDescriptionCreateParameters withExternalDocsDescription(String externalDocsDescription) { + this.externalDocsDescription = externalDocsDescription; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceCollection.java new file mode 100644 index 0000000000000..c8c8bcc4b54f6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Tag list representation. */ +@Fluent +public final class TagResourceCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagResourceCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the TagResourceCollection object itself. + */ + public TagResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the TagResourceCollection object itself. + */ + public TagResourceCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the TagResourceCollection object itself. + */ + public TagResourceCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContract.java new file mode 100644 index 0000000000000..4c74f293a7462 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner; + +/** An immutable client-side representation of TagResourceContract. */ +public interface TagResourceContract { + /** + * Gets the tag property: Tag associated with the resource. + * + * @return the tag value. + */ + TagResourceContractProperties tag(); + + /** + * Gets the api property: Api associated with the tag. + * + * @return the api value. + */ + ApiTagResourceContractProperties api(); + + /** + * Gets the operation property: Operation associated with the tag. + * + * @return the operation value. + */ + OperationTagResourceContractProperties operation(); + + /** + * Gets the product property: Product associated with the tag. + * + * @return the product value. + */ + ProductTagResourceContractProperties product(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.TagResourceContractInner object. + * + * @return the inner object. + */ + TagResourceContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContractProperties.java new file mode 100644 index 0000000000000..4516d3f53dc07 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResourceContractProperties.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.apimanagement.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; + +/** Contract defining the Tag property in the Tag Resource Contract. */ +@Fluent +public final class TagResourceContractProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagResourceContractProperties.class); + + /* + * Tag identifier + */ + @JsonProperty(value = "id") + private String id; + + /* + * Tag Name + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id property: Tag identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Tag identifier. + * + * @param id the id value to set. + * @return the TagResourceContractProperties object itself. + */ + public TagResourceContractProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Tag Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Tag Name. + * + * @param name the name value to set. + * @return the TagResourceContractProperties object itself. + */ + public TagResourceContractProperties withName(String 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResources.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResources.java new file mode 100644 index 0000000000000..c598619819c4f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagResources.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of TagResources. */ +public interface TagResources { + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of resources associated with tags. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| aid | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiName | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| apiRevision | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| path | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| description | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| serviceUrl | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| method | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| urlTemplate | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| terms | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| isCurrent | + * filter | eq | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Tags.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Tags.java new file mode 100644 index 0000000000000..b568da1a641ec --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Tags.java @@ -0,0 +1,711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Tags. */ +public interface Tags { + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId); + + /** + * Lists all Tags associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByOperation( + String resourceGroupName, + String serviceName, + String apiId, + String operationId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityStateByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + Response getEntityStateByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + TagContract getByOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Get tag associated with the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Operation. + */ + Response getByOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + TagContract assignToOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Assign tag to the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + Response assignToOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFromOperation( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId); + + /** + * Detach the tag from the Operation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param operationId Operation identifier within an API. Must be unique in the current API Management service + * instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response detachFromOperationWithResponse( + String resourceGroupName, String serviceName, String apiId, String operationId, String tagId, Context context); + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByApi(String resourceGroupName, String serviceName, String apiId); + + /** + * Lists all Tags associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByApi( + String resourceGroupName, + String serviceName, + String apiId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityStateByApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + Response getEntityStateByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + TagContract getByApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Get tag associated with the API. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the API. + */ + Response getByApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + TagContract assignToApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Assign tag to the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + Response assignToApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFromApi(String resourceGroupName, String serviceName, String apiId, String tagId); + + /** + * Detach the tag from the Api. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param apiId API revision identifier. Must be unique in the current API Management service instance. Non-current + * revision has ;rev=n as a suffix where n is the revision number. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response detachFromApiWithResponse( + String resourceGroupName, String serviceName, String apiId, String tagId, Context context); + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByProduct(String resourceGroupName, String serviceName, String productId); + + /** + * Lists all Tags associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| displayName | filter | ge, + * le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByProduct( + String resourceGroupName, + String serviceName, + String productId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityStateByProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + Response getEntityStateByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + TagContract getByProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Get tag associated with the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag associated with the Product. + */ + Response getByProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + TagContract assignToProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Assign tag to the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag Contract details. + */ + Response assignToProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 detachFromProduct(String resourceGroupName, String serviceName, String productId, String tagId); + + /** + * Detach the tag from the Product. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param productId Product identifier. Must be unique in the current API Management service instance. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response detachFromProductWithResponse( + String resourceGroupName, String serviceName, String productId, String tagId, Context context); + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of tags defined within a service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param scope Scope like 'apis', 'products' or 'apis/{apiId}. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Tag list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + String scope, + Context context); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityState(String resourceGroupName, String serviceName, String tagId); + + /** + * Gets the entity state version of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state version of the tag specified by its identifier. + */ + Response getEntityStateWithResponse( + String resourceGroupName, String serviceName, String tagId, Context context); + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + TagContract get(String resourceGroupName, String serviceName, String tagId); + + /** + * Gets the details of the tag specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + Response getWithResponse(String resourceGroupName, String serviceName, String tagId, Context context); + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String tagId, String ifMatch); + + /** + * Deletes specific tag of the API Management service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param tagId Tag identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String serviceName, String tagId, String ifMatch, Context context); + + /** + * Gets the details of the tag specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + TagContract getById(String id); + + /** + * Gets the details of the tag specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the tag specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific tag of the API Management service instance. + * + * @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 specific tag of the API Management service instance. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new TagContract resource. + * + * @param name resource name. + * @return the first stage of the new TagContract definition. + */ + TagContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiHeaders.java new file mode 100644 index 0000000000000..8afb757561a3d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiHeaders.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.apimanagement.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 TagsAssignToApiHeaders model. */ +@Fluent +public final class TagsAssignToApiHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsAssignToApiHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsAssignToApiHeaders object itself. + */ + public TagsAssignToApiHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiResponse.java new file mode 100644 index 0000000000000..f45683804b20e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsAssignToApiResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the assignToApi operation. */ +public final class TagsAssignToApiResponse extends ResponseBase { + /** + * Creates an instance of TagsAssignToApiResponse. + * + * @param request the request which resulted in this TagsAssignToApiResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsAssignToApiResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagContractInner value, + TagsAssignToApiHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..c71e4f8995721 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateHeaders.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.apimanagement.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 TagsCreateOrUpdateHeaders model. */ +@Fluent +public final class TagsCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsCreateOrUpdateHeaders object itself. + */ + public TagsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..c36aa7cecdeef --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class TagsCreateOrUpdateResponse extends ResponseBase { + /** + * Creates an instance of TagsCreateOrUpdateResponse. + * + * @param request the request which resulted in this TagsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagContractInner value, + TagsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiHeaders.java new file mode 100644 index 0000000000000..1f6fc4b24b632 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiHeaders.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.apimanagement.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 TagsGetByApiHeaders model. */ +@Fluent +public final class TagsGetByApiHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetByApiHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetByApiHeaders object itself. + */ + public TagsGetByApiHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiResponse.java new file mode 100644 index 0000000000000..55283a42af567 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByApiResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the getByApi operation. */ +public final class TagsGetByApiResponse extends ResponseBase { + /** + * Creates an instance of TagsGetByApiResponse. + * + * @param request the request which resulted in this TagsGetByApiResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetByApiResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagContractInner value, + TagsGetByApiHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationHeaders.java new file mode 100644 index 0000000000000..ea62d934e9635 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationHeaders.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.apimanagement.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 TagsGetByOperationHeaders model. */ +@Fluent +public final class TagsGetByOperationHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetByOperationHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetByOperationHeaders object itself. + */ + public TagsGetByOperationHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationResponse.java new file mode 100644 index 0000000000000..8a127d2e04ca4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByOperationResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the getByOperation operation. */ +public final class TagsGetByOperationResponse extends ResponseBase { + /** + * Creates an instance of TagsGetByOperationResponse. + * + * @param request the request which resulted in this TagsGetByOperationResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetByOperationResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagContractInner value, + TagsGetByOperationHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductHeaders.java new file mode 100644 index 0000000000000..25f49c6e89c24 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductHeaders.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.apimanagement.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 TagsGetByProductHeaders model. */ +@Fluent +public final class TagsGetByProductHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetByProductHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetByProductHeaders object itself. + */ + public TagsGetByProductHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductResponse.java new file mode 100644 index 0000000000000..696b61ac231f1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetByProductResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the getByProduct operation. */ +public final class TagsGetByProductResponse extends ResponseBase { + /** + * Creates an instance of TagsGetByProductResponse. + * + * @param request the request which resulted in this TagsGetByProductResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetByProductResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagContractInner value, + TagsGetByProductHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiHeaders.java new file mode 100644 index 0000000000000..16041223146df --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiHeaders.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.apimanagement.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 TagsGetEntityStateByApiHeaders model. */ +@Fluent +public final class TagsGetEntityStateByApiHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetEntityStateByApiHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetEntityStateByApiHeaders object itself. + */ + public TagsGetEntityStateByApiHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiResponse.java new file mode 100644 index 0000000000000..3368fa8f67ba4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByApiResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityStateByApi operation. */ +public final class TagsGetEntityStateByApiResponse extends ResponseBase { + /** + * Creates an instance of TagsGetEntityStateByApiResponse. + * + * @param request the request which resulted in this TagsGetEntityStateByApiResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetEntityStateByApiResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + TagsGetEntityStateByApiHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationHeaders.java new file mode 100644 index 0000000000000..5cd38bcbd92c8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationHeaders.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.apimanagement.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 TagsGetEntityStateByOperationHeaders model. */ +@Fluent +public final class TagsGetEntityStateByOperationHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetEntityStateByOperationHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetEntityStateByOperationHeaders object itself. + */ + public TagsGetEntityStateByOperationHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationResponse.java new file mode 100644 index 0000000000000..cc7a642248e5e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByOperationResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityStateByOperation operation. */ +public final class TagsGetEntityStateByOperationResponse + extends ResponseBase { + /** + * Creates an instance of TagsGetEntityStateByOperationResponse. + * + * @param request the request which resulted in this TagsGetEntityStateByOperationResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetEntityStateByOperationResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + TagsGetEntityStateByOperationHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductHeaders.java new file mode 100644 index 0000000000000..260f0d5fd17b8 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductHeaders.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.apimanagement.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 TagsGetEntityStateByProductHeaders model. */ +@Fluent +public final class TagsGetEntityStateByProductHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetEntityStateByProductHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetEntityStateByProductHeaders object itself. + */ + public TagsGetEntityStateByProductHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductResponse.java new file mode 100644 index 0000000000000..d42eeb178ceb1 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateByProductResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityStateByProduct operation. */ +public final class TagsGetEntityStateByProductResponse extends ResponseBase { + /** + * Creates an instance of TagsGetEntityStateByProductResponse. + * + * @param request the request which resulted in this TagsGetEntityStateByProductResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetEntityStateByProductResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + TagsGetEntityStateByProductHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateHeaders.java new file mode 100644 index 0000000000000..f7e4c03e76025 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateHeaders.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.apimanagement.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 TagsGetEntityStateHeaders model. */ +@Fluent +public final class TagsGetEntityStateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetEntityStateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetEntityStateHeaders object itself. + */ + public TagsGetEntityStateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateResponse.java new file mode 100644 index 0000000000000..2fd43aa3f9f5a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetEntityStateResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityState operation. */ +public final class TagsGetEntityStateResponse extends ResponseBase { + /** + * Creates an instance of TagsGetEntityStateResponse. + * + * @param request the request which resulted in this TagsGetEntityStateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetEntityStateResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, TagsGetEntityStateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetHeaders.java new file mode 100644 index 0000000000000..0b67324c61e04 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetHeaders.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.apimanagement.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 TagsGetHeaders model. */ +@Fluent +public final class TagsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsGetHeaders object itself. + */ + public TagsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetResponse.java new file mode 100644 index 0000000000000..ba9157f47ca65 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsGetResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the get operation. */ +public final class TagsGetResponse extends ResponseBase { + /** + * Creates an instance of TagsGetResponse. + * + * @param request the request which resulted in this TagsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsGetResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, TagContractInner value, TagsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateHeaders.java new file mode 100644 index 0000000000000..92facb159839b --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateHeaders.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.apimanagement.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 TagsUpdateHeaders model. */ +@Fluent +public final class TagsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TagsUpdateHeaders object itself. + */ + public TagsUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateResponse.java new file mode 100644 index 0000000000000..e2184e4f6b39a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TagsUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TagContractInner; + +/** Contains all response data for the update operation. */ +public final class TagsUpdateResponse extends ResponseBase { + /** + * Creates an instance of TagsUpdateResponse. + * + * @param request the request which resulted in this TagsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TagsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TagContractInner value, + TagsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TagContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TemplateName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TemplateName.java new file mode 100644 index 0000000000000..7703cdcf3012a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TemplateName.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TemplateName. */ +public final class TemplateName extends ExpandableStringEnum { + /** Static value applicationApprovedNotificationMessage for TemplateName. */ + public static final TemplateName APPLICATION_APPROVED_NOTIFICATION_MESSAGE = + fromString("applicationApprovedNotificationMessage"); + + /** Static value accountClosedDeveloper for TemplateName. */ + public static final TemplateName ACCOUNT_CLOSED_DEVELOPER = fromString("accountClosedDeveloper"); + + /** Static value quotaLimitApproachingDeveloperNotificationMessage for TemplateName. */ + public static final TemplateName QUOTA_LIMIT_APPROACHING_DEVELOPER_NOTIFICATION_MESSAGE = + fromString("quotaLimitApproachingDeveloperNotificationMessage"); + + /** Static value newDeveloperNotificationMessage for TemplateName. */ + public static final TemplateName NEW_DEVELOPER_NOTIFICATION_MESSAGE = fromString("newDeveloperNotificationMessage"); + + /** Static value emailChangeIdentityDefault for TemplateName. */ + public static final TemplateName EMAIL_CHANGE_IDENTITY_DEFAULT = fromString("emailChangeIdentityDefault"); + + /** Static value inviteUserNotificationMessage for TemplateName. */ + public static final TemplateName INVITE_USER_NOTIFICATION_MESSAGE = fromString("inviteUserNotificationMessage"); + + /** Static value newCommentNotificationMessage for TemplateName. */ + public static final TemplateName NEW_COMMENT_NOTIFICATION_MESSAGE = fromString("newCommentNotificationMessage"); + + /** Static value confirmSignUpIdentityDefault for TemplateName. */ + public static final TemplateName CONFIRM_SIGN_UP_IDENTITY_DEFAULT = fromString("confirmSignUpIdentityDefault"); + + /** Static value newIssueNotificationMessage for TemplateName. */ + public static final TemplateName NEW_ISSUE_NOTIFICATION_MESSAGE = fromString("newIssueNotificationMessage"); + + /** Static value purchaseDeveloperNotificationMessage for TemplateName. */ + public static final TemplateName PURCHASE_DEVELOPER_NOTIFICATION_MESSAGE = + fromString("purchaseDeveloperNotificationMessage"); + + /** Static value passwordResetIdentityDefault for TemplateName. */ + public static final TemplateName PASSWORD_RESET_IDENTITY_DEFAULT = fromString("passwordResetIdentityDefault"); + + /** Static value passwordResetByAdminNotificationMessage for TemplateName. */ + public static final TemplateName PASSWORD_RESET_BY_ADMIN_NOTIFICATION_MESSAGE = + fromString("passwordResetByAdminNotificationMessage"); + + /** Static value rejectDeveloperNotificationMessage for TemplateName. */ + public static final TemplateName REJECT_DEVELOPER_NOTIFICATION_MESSAGE = + fromString("rejectDeveloperNotificationMessage"); + + /** Static value requestDeveloperNotificationMessage for TemplateName. */ + public static final TemplateName REQUEST_DEVELOPER_NOTIFICATION_MESSAGE = + fromString("requestDeveloperNotificationMessage"); + + /** + * Creates or finds a TemplateName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TemplateName. + */ + @JsonCreator + public static TemplateName fromString(String name) { + return fromString(name, TemplateName.class); + } + + /** @return known TemplateName values. */ + public static Collection values() { + return values(TemplateName.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccess.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccess.java new file mode 100644 index 0000000000000..64ff52417e609 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccess.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 TenantAccess. */ +public interface TenantAccess { + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Returns list of access infos - for Git and Management endpoints. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context); + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + void getEntityTag(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Tenant access metadata. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + AccessInformationContract get(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Get tenant access information details without secrets. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details without secrets. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate primary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate secondary access key. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + AccessInformationSecretsContract listSecrets(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Get tenant access information details. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 tenant access information details. + */ + Response listSecretsWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Get tenant access information details without secrets. + * + * @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 tenant access information details without secrets. + */ + AccessInformationContract getById(String id); + + /** + * Get tenant access information details without secrets. + * + * @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 tenant access information details without secrets. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AccessInformationContract resource. + * + * @param name resource name. + * @return the first stage of the new AccessInformationContract definition. + */ + AccessInformationContract.DefinitionStages.Blank define(AccessIdName name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateHeaders.java new file mode 100644 index 0000000000000..9a44dd5a45378 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateHeaders.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.apimanagement.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 TenantAccessCreateHeaders model. */ +@Fluent +public final class TenantAccessCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessCreateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TenantAccessCreateHeaders object itself. + */ + public TenantAccessCreateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateResponse.java new file mode 100644 index 0000000000000..c729a92bf1808 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessCreateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; + +/** Contains all response data for the create operation. */ +public final class TenantAccessCreateResponse + extends ResponseBase { + /** + * Creates an instance of TenantAccessCreateResponse. + * + * @param request the request which resulted in this TenantAccessCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TenantAccessCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AccessInformationContractInner value, + TenantAccessCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AccessInformationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagHeaders.java new file mode 100644 index 0000000000000..1b2fe11e4bcbc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagHeaders.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.apimanagement.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 TenantAccessGetEntityTagHeaders model. */ +@Fluent +public final class TenantAccessGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TenantAccessGetEntityTagHeaders object itself. + */ + public TenantAccessGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagResponse.java new file mode 100644 index 0000000000000..749ed93f8e003 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetEntityTagResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class TenantAccessGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of TenantAccessGetEntityTagResponse. + * + * @param request the request which resulted in this TenantAccessGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TenantAccessGetEntityTagResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + TenantAccessGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetHeaders.java new file mode 100644 index 0000000000000..b123eaaededc5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetHeaders.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.apimanagement.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 TenantAccessGetHeaders model. */ +@Fluent +public final class TenantAccessGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TenantAccessGetHeaders object itself. + */ + public TenantAccessGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetResponse.java new file mode 100644 index 0000000000000..3d465890d2144 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; + +/** Contains all response data for the get operation. */ +public final class TenantAccessGetResponse + extends ResponseBase { + /** + * Creates an instance of TenantAccessGetResponse. + * + * @param request the request which resulted in this TenantAccessGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TenantAccessGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AccessInformationContractInner value, + TenantAccessGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AccessInformationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGits.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGits.java new file mode 100644 index 0000000000000..8b1966535dd17 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessGits.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TenantAccessGits. */ +public interface TenantAccessGits { + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + void regeneratePrimaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate primary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + Response regeneratePrimaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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. + */ + void regenerateSecondaryKey(String resourceGroupName, String serviceName, AccessIdName accessName); + + /** + * Regenerate secondary access key for GIT. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param accessName The identifier of the Access 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 the response. + */ + Response regenerateSecondaryKeyWithResponse( + String resourceGroupName, String serviceName, AccessIdName accessName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsHeaders.java new file mode 100644 index 0000000000000..ad47276b55499 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsHeaders.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.apimanagement.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 TenantAccessListSecretsHeaders model. */ +@Fluent +public final class TenantAccessListSecretsHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessListSecretsHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TenantAccessListSecretsHeaders object itself. + */ + public TenantAccessListSecretsHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsResponse.java new file mode 100644 index 0000000000000..8ca2933e0d95e --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessListSecretsResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationSecretsContractInner; + +/** Contains all response data for the listSecrets operation. */ +public final class TenantAccessListSecretsResponse + extends ResponseBase { + /** + * Creates an instance of TenantAccessListSecretsResponse. + * + * @param request the request which resulted in this TenantAccessListSecretsResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TenantAccessListSecretsResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AccessInformationSecretsContractInner value, + TenantAccessListSecretsHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AccessInformationSecretsContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateHeaders.java new file mode 100644 index 0000000000000..c90eb9e04705c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateHeaders.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.apimanagement.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 TenantAccessUpdateHeaders model. */ +@Fluent +public final class TenantAccessUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantAccessUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TenantAccessUpdateHeaders object itself. + */ + public TenantAccessUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateResponse.java new file mode 100644 index 0000000000000..3e3f25c3e4720 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantAccessUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.AccessInformationContractInner; + +/** Contains all response data for the update operation. */ +public final class TenantAccessUpdateResponse + extends ResponseBase { + /** + * Creates an instance of TenantAccessUpdateResponse. + * + * @param request the request which resulted in this TenantAccessUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TenantAccessUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AccessInformationContractInner value, + TenantAccessUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AccessInformationContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurationSyncStateContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurationSyncStateContract.java new file mode 100644 index 0000000000000..ed8254058997a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurationSyncStateContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.TenantConfigurationSyncStateContractInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of TenantConfigurationSyncStateContract. */ +public interface TenantConfigurationSyncStateContract { + /** + * Gets the branch property: The name of Git branch. + * + * @return the branch value. + */ + String branch(); + + /** + * Gets the commitId property: The latest commit Id. + * + * @return the commitId value. + */ + String commitId(); + + /** + * Gets the isExport property: value indicating if last sync was save (true) or deploy (false) operation. + * + * @return the isExport value. + */ + Boolean isExport(); + + /** + * Gets the isSynced property: value indicating if last synchronization was later than the configuration change. + * + * @return the isSynced value. + */ + Boolean isSynced(); + + /** + * Gets the isGitEnabled property: value indicating whether Git configuration access is enabled. + * + * @return the isGitEnabled value. + */ + Boolean isGitEnabled(); + + /** + * Gets the syncDate property: The date of the latest synchronization. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the syncDate value. + */ + OffsetDateTime syncDate(); + + /** + * Gets the configurationChangeDate property: The date of the latest configuration change. The date conforms to the + * following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the configurationChangeDate value. + */ + OffsetDateTime configurationChangeDate(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.TenantConfigurationSyncStateContractInner + * object. + * + * @return the inner object. + */ + TenantConfigurationSyncStateContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurations.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurations.java new file mode 100644 index 0000000000000..80612257ccf21 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantConfigurations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TenantConfigurations. */ +public interface TenantConfigurations { + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + OperationResultContract deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters); + + /** + * This operation applies changes from the specified Git branch to the configuration database. This is a long + * running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Deploy Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + OperationResultContract deploy( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context); + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + OperationResultContract save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters); + + /** + * This operation creates a commit with the current configuration snapshot to the specified branch in the + * repository. This is a long running operation and could take several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Save Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + OperationResultContract save( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + SaveConfigurationParameter parameters, + Context context); + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + OperationResultContract validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters); + + /** + * This operation validates the changes in the specified Git branch. This is a long running operation and could take + * several minutes to complete. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param parameters Validate Configuration parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation Result. + */ + OperationResultContract validate( + String resourceGroupName, + String serviceName, + ConfigurationIdName configurationName, + DeployConfigurationParameters parameters, + Context context); + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + TenantConfigurationSyncStateContract getSyncState( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName); + + /** + * Gets the status of the most recent synchronization between the configuration database and the Git repository. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param configurationName The identifier of the Git Configuration Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the most recent synchronization between the configuration database and the Git repository. + */ + Response getSyncStateWithResponse( + String resourceGroupName, String serviceName, ConfigurationIdName configurationName, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettings.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettings.java new file mode 100644 index 0000000000000..a43a7b54e18bf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettings.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 TenantSettings. */ +public interface TenantSettings { + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Public settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter Not used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged AccessInformation list representation. + */ + PagedIterable listByService( + String resourceGroupName, String serviceName, String filter, Context context); + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + TenantSettingsContract get(String resourceGroupName, String serviceName, SettingsTypeName settingsType); + + /** + * Get tenant settings. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param settingsType The identifier of the settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tenant settings. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, SettingsTypeName settingsType, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsCollection.java new file mode 100644 index 0000000000000..fc9be3edbf3f2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsCollection.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.apimanagement.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged AccessInformation list representation. */ +@Immutable +public final class TenantSettingsCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantSettingsCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsContract.java new file mode 100644 index 0000000000000..c33126757fd83 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; +import java.util.Map; + +/** An immutable client-side representation of TenantSettingsContract. */ +public interface TenantSettingsContract { + /** + * 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 settings property: Tenant settings. + * + * @return the settings value. + */ + Map settings(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner object. + * + * @return the inner object. + */ + TenantSettingsContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetHeaders.java new file mode 100644 index 0000000000000..bf7d5aa6af405 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetHeaders.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.apimanagement.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 TenantSettingsGetHeaders model. */ +@Fluent +public final class TenantSettingsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TenantSettingsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the TenantSettingsGetHeaders object itself. + */ + public TenantSettingsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetResponse.java new file mode 100644 index 0000000000000..a2840f8459dcd --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TenantSettingsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.TenantSettingsContractInner; + +/** Contains all response data for the get operation. */ +public final class TenantSettingsGetResponse + extends ResponseBase { + /** + * Creates an instance of TenantSettingsGetResponse. + * + * @param request the request which resulted in this TenantSettingsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TenantSettingsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TenantSettingsContractInner value, + TenantSettingsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TenantSettingsContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TermsOfServiceProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TermsOfServiceProperties.java new file mode 100644 index 0000000000000..af807414c51d6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TermsOfServiceProperties.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.apimanagement.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; + +/** Terms of service contract properties. */ +@Fluent +public final class TermsOfServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TermsOfServiceProperties.class); + + /* + * A terms of service text. + */ + @JsonProperty(value = "text") + private String text; + + /* + * Display terms of service during a sign-up process. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Ask user for consent to the terms of service. + */ + @JsonProperty(value = "consentRequired") + private Boolean consentRequired; + + /** + * Get the text property: A terms of service text. + * + * @return the text value. + */ + public String text() { + return this.text; + } + + /** + * Set the text property: A terms of service text. + * + * @param text the text value to set. + * @return the TermsOfServiceProperties object itself. + */ + public TermsOfServiceProperties withText(String text) { + this.text = text; + return this; + } + + /** + * Get the enabled property: Display terms of service during a sign-up process. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Display terms of service during a sign-up process. + * + * @param enabled the enabled value to set. + * @return the TermsOfServiceProperties object itself. + */ + public TermsOfServiceProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the consentRequired property: Ask user for consent to the terms of service. + * + * @return the consentRequired value. + */ + public Boolean consentRequired() { + return this.consentRequired; + } + + /** + * Set the consentRequired property: Ask user for consent to the terms of service. + * + * @param consentRequired the consentRequired value to set. + * @return the TermsOfServiceProperties object itself. + */ + public TermsOfServiceProperties withConsentRequired(Boolean consentRequired) { + this.consentRequired = consentRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TokenBodyParameterContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TokenBodyParameterContract.java new file mode 100644 index 0000000000000..973ea5c37d752 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/TokenBodyParameterContract.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** OAuth acquire token request body parameter (www-url-form-encoded). */ +@Fluent +public final class TokenBodyParameterContract { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TokenBodyParameterContract.class); + + /* + * body parameter name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * body parameter value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name property: body parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: body parameter name. + * + * @param name the name value to set. + * @return the TokenBodyParameterContract object itself. + */ + public TokenBodyParameterContract withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: body parameter value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: body parameter value. + * + * @param value the value value to set. + * @return the TokenBodyParameterContract object itself. + */ + public TokenBodyParameterContract withValue(String value) { + this.value = value; + 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 TokenBodyParameterContract")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model TokenBodyParameterContract")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCollection.java new file mode 100644 index 0000000000000..05827a5af964f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Paged Users list representation. */ +@Fluent +public final class UserCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserCollection.class); + + /* + * Page values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Page values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Page values. + * + * @param value the value value to set. + * @return the UserCollection object itself. + */ + public UserCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the UserCollection object itself. + */ + public UserCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the UserCollection object itself. + */ + public UserCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserConfirmationPasswords.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserConfirmationPasswords.java new file mode 100644 index 0000000000000..a78660767b13a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserConfirmationPasswords.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.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of UserConfirmationPasswords. */ +public interface UserConfirmationPasswords { + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 send(String resourceGroupName, String serviceName, String userId); + + /** + * Sends confirmation. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response sendWithResponse( + String resourceGroupName, String serviceName, String userId, AppType appType, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContract.java new file mode 100644 index 0000000000000..29d1e530cc274 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContract.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of UserContract. */ +public interface UserContract { + /** + * 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 state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @return the state value. + */ + UserState state(); + + /** + * Gets the note property: Optional note about a user set by the administrator. + * + * @return the note value. + */ + String note(); + + /** + * Gets the identities property: Collection of user identities. + * + * @return the identities value. + */ + List identities(); + + /** + * Gets the firstName property: First name. + * + * @return the firstName value. + */ + String firstName(); + + /** + * Gets the lastName property: Last name. + * + * @return the lastName value. + */ + String lastName(); + + /** + * Gets the email property: Email address. + * + * @return the email value. + */ + String email(); + + /** + * Gets the registrationDate property: Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the registrationDate value. + */ + OffsetDateTime registrationDate(); + + /** + * Gets the groups property: Collection of groups user is part of. + * + * @return the groups value. + */ + List groups(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner object. + * + * @return the inner object. + */ + UserContractInner innerModel(); + + /** The entirety of the UserContract definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The UserContract definition stages. */ + interface DefinitionStages { + /** The first stage of the UserContract definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the UserContract definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @return the next definition stage. + */ + WithCreate withExistingService(String resourceGroupName, String serviceName); + } + /** + * The stage of the UserContract 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.WithState, + DefinitionStages.WithNote, + DefinitionStages.WithIdentities, + DefinitionStages.WithEmail, + DefinitionStages.WithFirstName, + DefinitionStages.WithLastName, + DefinitionStages.WithPassword, + DefinitionStages.WithAppType, + DefinitionStages.WithConfirmation, + DefinitionStages.WithNotify, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + UserContract create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + UserContract create(Context context); + } + /** The stage of the UserContract definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Account state. Specifies whether the user is active or not. Blocked users + * are unable to sign into the developer portal or call any APIs of subscribed products. Default state is + * Active.. + * + * @param state Account state. Specifies whether the user is active or not. Blocked users are unable to sign + * into the developer portal or call any APIs of subscribed products. Default state is Active. + * @return the next definition stage. + */ + WithCreate withState(UserState state); + } + /** The stage of the UserContract definition allowing to specify note. */ + interface WithNote { + /** + * Specifies the note property: Optional note about a user set by the administrator.. + * + * @param note Optional note about a user set by the administrator. + * @return the next definition stage. + */ + WithCreate withNote(String note); + } + /** The stage of the UserContract definition allowing to specify identities. */ + interface WithIdentities { + /** + * Specifies the identities property: Collection of user identities.. + * + * @param identities Collection of user identities. + * @return the next definition stage. + */ + WithCreate withIdentities(List identities); + } + /** The stage of the UserContract definition allowing to specify email. */ + interface WithEmail { + /** + * Specifies the email property: Email address. Must not be empty and must be unique within the service + * instance.. + * + * @param email Email address. Must not be empty and must be unique within the service instance. + * @return the next definition stage. + */ + WithCreate withEmail(String email); + } + /** The stage of the UserContract definition allowing to specify firstName. */ + interface WithFirstName { + /** + * Specifies the firstName property: First name.. + * + * @param firstName First name. + * @return the next definition stage. + */ + WithCreate withFirstName(String firstName); + } + /** The stage of the UserContract definition allowing to specify lastName. */ + interface WithLastName { + /** + * Specifies the lastName property: Last name.. + * + * @param lastName Last name. + * @return the next definition stage. + */ + WithCreate withLastName(String lastName); + } + /** The stage of the UserContract definition allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: User Password. If no value is provided, a default password is + * generated.. + * + * @param password User Password. If no value is provided, a default password is generated. + * @return the next definition stage. + */ + WithCreate withPassword(String password); + } + /** The stage of the UserContract definition allowing to specify appType. */ + interface WithAppType { + /** + * Specifies the appType property: Determines the type of application which send the create user request. + * Default is legacy portal.. + * + * @param appType Determines the type of application which send the create user request. Default is legacy + * portal. + * @return the next definition stage. + */ + WithCreate withAppType(AppType appType); + } + /** The stage of the UserContract definition allowing to specify confirmation. */ + interface WithConfirmation { + /** + * Specifies the confirmation property: Determines the type of confirmation e-mail that will be sent to the + * newly created user.. + * + * @param confirmation Determines the type of confirmation e-mail that will be sent to the newly created + * user. + * @return the next definition stage. + */ + WithCreate withConfirmation(Confirmation confirmation); + } + /** The stage of the UserContract definition allowing to specify notify. */ + interface WithNotify { + /** + * Specifies the notify property: Send an Email notification to the User.. + * + * @param notify Send an Email notification to the User. + * @return the next definition stage. + */ + WithCreate withNotify(Boolean notify); + } + /** The stage of the UserContract definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. Not required when creating an entity, but required + * when updating an entity.. + * + * @param ifMatch ETag of the Entity. Not required when creating an entity, but required when updating an + * entity. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the UserContract resource. + * + * @return the stage of resource update. + */ + UserContract.Update update(); + + /** The template for UserContract update. */ + interface Update + extends UpdateStages.WithState, + UpdateStages.WithNote, + UpdateStages.WithIdentities, + UpdateStages.WithEmail, + UpdateStages.WithPassword, + UpdateStages.WithFirstName, + UpdateStages.WithLastName, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + UserContract apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + UserContract apply(Context context); + } + /** The UserContract update stages. */ + interface UpdateStages { + /** The stage of the UserContract update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Account state. Specifies whether the user is active or not. Blocked users + * are unable to sign into the developer portal or call any APIs of subscribed products. Default state is + * Active.. + * + * @param state Account state. Specifies whether the user is active or not. Blocked users are unable to sign + * into the developer portal or call any APIs of subscribed products. Default state is Active. + * @return the next definition stage. + */ + Update withState(UserState state); + } + /** The stage of the UserContract update allowing to specify note. */ + interface WithNote { + /** + * Specifies the note property: Optional note about a user set by the administrator.. + * + * @param note Optional note about a user set by the administrator. + * @return the next definition stage. + */ + Update withNote(String note); + } + /** The stage of the UserContract update allowing to specify identities. */ + interface WithIdentities { + /** + * Specifies the identities property: Collection of user identities.. + * + * @param identities Collection of user identities. + * @return the next definition stage. + */ + Update withIdentities(List identities); + } + /** The stage of the UserContract update allowing to specify email. */ + interface WithEmail { + /** + * Specifies the email property: Email address. Must not be empty and must be unique within the service + * instance.. + * + * @param email Email address. Must not be empty and must be unique within the service instance. + * @return the next definition stage. + */ + Update withEmail(String email); + } + /** The stage of the UserContract update allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: User Password.. + * + * @param password User Password. + * @return the next definition stage. + */ + Update withPassword(String password); + } + /** The stage of the UserContract update allowing to specify firstName. */ + interface WithFirstName { + /** + * Specifies the firstName property: First name.. + * + * @param firstName First name. + * @return the next definition stage. + */ + Update withFirstName(String firstName); + } + /** The stage of the UserContract update allowing to specify lastName. */ + interface WithLastName { + /** + * Specifies the lastName property: Last name.. + * + * @param lastName Last name. + * @return the next definition stage. + */ + Update withLastName(String lastName); + } + /** The stage of the UserContract update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the Entity. ETag should match the current entity state from the + * header response of the GET request or it should be * for unconditional update.. + * + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of + * the GET request or it should be * for unconditional update. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + UserContract refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + UserContract refresh(Context context); + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + GenerateSsoUrlResult generateSsoUrl(); + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + Response generateSsoUrlWithResponse(Context context); + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param parameters Create Authorization Token parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + UserTokenResult getSharedAccessToken(UserTokenParameters parameters); + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param parameters Create Authorization Token parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + Response getSharedAccessTokenWithResponse(UserTokenParameters parameters, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContractProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContractProperties.java new file mode 100644 index 0000000000000..e7ae123b1ddd7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserContractProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** User profile. */ +@Fluent +public final class UserContractProperties extends UserEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserContractProperties.class); + + /* + * First name. + */ + @JsonProperty(value = "firstName") + private String firstName; + + /* + * Last name. + */ + @JsonProperty(value = "lastName") + private String lastName; + + /* + * Email address. + */ + @JsonProperty(value = "email") + private String email; + + /* + * Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "registrationDate") + private OffsetDateTime registrationDate; + + /* + * Collection of groups user is part of. + */ + @JsonProperty(value = "groups", access = JsonProperty.Access.WRITE_ONLY) + private List groups; + + /** + * Get the firstName property: First name. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name. + * + * @param firstName the firstName value to set. + * @return the UserContractProperties object itself. + */ + public UserContractProperties withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name. + * + * @param lastName the lastName value to set. + * @return the UserContractProperties object itself. + */ + public UserContractProperties withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the email property: Email address. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address. + * + * @param email the email value to set. + * @return the UserContractProperties object itself. + */ + public UserContractProperties withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the registrationDate property: Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the registrationDate value. + */ + public OffsetDateTime registrationDate() { + return this.registrationDate; + } + + /** + * Set the registrationDate property: Date of user registration. The date conforms to the following format: + * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param registrationDate the registrationDate value to set. + * @return the UserContractProperties object itself. + */ + public UserContractProperties withRegistrationDate(OffsetDateTime registrationDate) { + this.registrationDate = registrationDate; + return this; + } + + /** + * Get the groups property: Collection of groups user is part of. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** {@inheritDoc} */ + @Override + public UserContractProperties withState(UserState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserContractProperties withNote(String note) { + super.withNote(note); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserContractProperties withIdentities(List identities) { + super.withIdentities(identities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameterProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameterProperties.java new file mode 100644 index 0000000000000..65cdd20a20c0f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameterProperties.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters supplied to the Create User operation. */ +@Fluent +public final class UserCreateParameterProperties extends UserEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserCreateParameterProperties.class); + + /* + * Email address. Must not be empty and must be unique within the service + * instance. + */ + @JsonProperty(value = "email", required = true) + private String email; + + /* + * First name. + */ + @JsonProperty(value = "firstName", required = true) + private String firstName; + + /* + * Last name. + */ + @JsonProperty(value = "lastName", required = true) + private String lastName; + + /* + * User Password. If no value is provided, a default password is generated. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Determines the type of application which send the create user request. + * Default is legacy portal. + */ + @JsonProperty(value = "appType") + private AppType appType; + + /* + * Determines the type of confirmation e-mail that will be sent to the + * newly created user. + */ + @JsonProperty(value = "confirmation") + private Confirmation confirmation; + + /** + * Get the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @param email the email value to set. + * @return the UserCreateParameterProperties object itself. + */ + public UserCreateParameterProperties withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the firstName property: First name. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name. + * + * @param firstName the firstName value to set. + * @return the UserCreateParameterProperties object itself. + */ + public UserCreateParameterProperties withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name. + * + * @param lastName the lastName value to set. + * @return the UserCreateParameterProperties object itself. + */ + public UserCreateParameterProperties withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the password property: User Password. If no value is provided, a default password is generated. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: User Password. If no value is provided, a default password is generated. + * + * @param password the password value to set. + * @return the UserCreateParameterProperties object itself. + */ + public UserCreateParameterProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the appType property: Determines the type of application which send the create user request. Default is + * legacy portal. + * + * @return the appType value. + */ + public AppType appType() { + return this.appType; + } + + /** + * Set the appType property: Determines the type of application which send the create user request. Default is + * legacy portal. + * + * @param appType the appType value to set. + * @return the UserCreateParameterProperties object itself. + */ + public UserCreateParameterProperties withAppType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get the confirmation property: Determines the type of confirmation e-mail that will be sent to the newly created + * user. + * + * @return the confirmation value. + */ + public Confirmation confirmation() { + return this.confirmation; + } + + /** + * Set the confirmation property: Determines the type of confirmation e-mail that will be sent to the newly created + * user. + * + * @param confirmation the confirmation value to set. + * @return the UserCreateParameterProperties object itself. + */ + public UserCreateParameterProperties withConfirmation(Confirmation confirmation) { + this.confirmation = confirmation; + return this; + } + + /** {@inheritDoc} */ + @Override + public UserCreateParameterProperties withState(UserState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserCreateParameterProperties withNote(String note) { + super.withNote(note); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserCreateParameterProperties withIdentities(List identities) { + super.withIdentities(identities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (email() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property email in model UserCreateParameterProperties")); + } + if (firstName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property firstName in model UserCreateParameterProperties")); + } + if (lastName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property lastName in model UserCreateParameterProperties")); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameters.java new file mode 100644 index 0000000000000..f0c83259b48e0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserCreateParameters.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** User create details. */ +@JsonFlatten +@Fluent +public class UserCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserCreateParameters.class); + + /* + * Account state. Specifies whether the user is active or not. Blocked + * users are unable to sign into the developer portal or call any APIs of + * subscribed products. Default state is Active. + */ + @JsonProperty(value = "properties.state") + private UserState state; + + /* + * Optional note about a user set by the administrator. + */ + @JsonProperty(value = "properties.note") + private String note; + + /* + * Collection of user identities. + */ + @JsonProperty(value = "properties.identities") + private List identities; + + /* + * Email address. Must not be empty and must be unique within the service + * instance. + */ + @JsonProperty(value = "properties.email") + private String email; + + /* + * First name. + */ + @JsonProperty(value = "properties.firstName") + private String firstName; + + /* + * Last name. + */ + @JsonProperty(value = "properties.lastName") + private String lastName; + + /* + * User Password. If no value is provided, a default password is generated. + */ + @JsonProperty(value = "properties.password") + private String password; + + /* + * Determines the type of application which send the create user request. + * Default is legacy portal. + */ + @JsonProperty(value = "properties.appType") + private AppType appType; + + /* + * Determines the type of confirmation e-mail that will be sent to the + * newly created user. + */ + @JsonProperty(value = "properties.confirmation") + private Confirmation confirmation; + + /** + * Get the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @return the state value. + */ + public UserState state() { + return this.state; + } + + /** + * Set the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @param state the state value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withState(UserState state) { + this.state = state; + return this; + } + + /** + * Get the note property: Optional note about a user set by the administrator. + * + * @return the note value. + */ + public String note() { + return this.note; + } + + /** + * Set the note property: Optional note about a user set by the administrator. + * + * @param note the note value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withNote(String note) { + this.note = note; + return this; + } + + /** + * Get the identities property: Collection of user identities. + * + * @return the identities value. + */ + public List identities() { + return this.identities; + } + + /** + * Set the identities property: Collection of user identities. + * + * @param identities the identities value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withIdentities(List identities) { + this.identities = identities; + return this; + } + + /** + * Get the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @param email the email value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the firstName property: First name. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name. + * + * @param firstName the firstName value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name. + * + * @param lastName the lastName value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get the password property: User Password. If no value is provided, a default password is generated. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: User Password. If no value is provided, a default password is generated. + * + * @param password the password value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the appType property: Determines the type of application which send the create user request. Default is + * legacy portal. + * + * @return the appType value. + */ + public AppType appType() { + return this.appType; + } + + /** + * Set the appType property: Determines the type of application which send the create user request. Default is + * legacy portal. + * + * @param appType the appType value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withAppType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get the confirmation property: Determines the type of confirmation e-mail that will be sent to the newly created + * user. + * + * @return the confirmation value. + */ + public Confirmation confirmation() { + return this.confirmation; + } + + /** + * Set the confirmation property: Determines the type of confirmation e-mail that will be sent to the newly created + * user. + * + * @param confirmation the confirmation value to set. + * @return the UserCreateParameters object itself. + */ + public UserCreateParameters withConfirmation(Confirmation confirmation) { + this.confirmation = confirmation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identities() != null) { + identities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserEntityBaseParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserEntityBaseParameters.java new file mode 100644 index 0000000000000..519e0c7051ca0 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserEntityBaseParameters.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** User Entity Base Parameters set. */ +@Fluent +public class UserEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserEntityBaseParameters.class); + + /* + * Account state. Specifies whether the user is active or not. Blocked + * users are unable to sign into the developer portal or call any APIs of + * subscribed products. Default state is Active. + */ + @JsonProperty(value = "state") + private UserState state; + + /* + * Optional note about a user set by the administrator. + */ + @JsonProperty(value = "note") + private String note; + + /* + * Collection of user identities. + */ + @JsonProperty(value = "identities") + private List identities; + + /** + * Get the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @return the state value. + */ + public UserState state() { + return this.state; + } + + /** + * Set the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @param state the state value to set. + * @return the UserEntityBaseParameters object itself. + */ + public UserEntityBaseParameters withState(UserState state) { + this.state = state; + return this; + } + + /** + * Get the note property: Optional note about a user set by the administrator. + * + * @return the note value. + */ + public String note() { + return this.note; + } + + /** + * Set the note property: Optional note about a user set by the administrator. + * + * @param note the note value to set. + * @return the UserEntityBaseParameters object itself. + */ + public UserEntityBaseParameters withNote(String note) { + this.note = note; + return this; + } + + /** + * Get the identities property: Collection of user identities. + * + * @return the identities value. + */ + public List identities() { + return this.identities; + } + + /** + * Set the identities property: Collection of user identities. + * + * @param identities the identities value to set. + * @return the UserEntityBaseParameters object itself. + */ + public UserEntityBaseParameters withIdentities(List identities) { + this.identities = identities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identities() != null) { + identities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserGroups.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserGroups.java new file mode 100644 index 0000000000000..19d9420b5bf8f --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserGroups.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.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of UserGroups. */ +public interface UserGroups { + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + PagedIterable list(String resourceGroupName, String serviceName, String userId); + + /** + * Lists all user groups. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>| name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| description | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Group list representation. + */ + PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentities.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentities.java new file mode 100644 index 0000000000000..d85a3aec4d133 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentities.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of UserIdentities. */ +public interface UserIdentities { + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Users Identity list representation. + */ + PagedIterable list(String resourceGroupName, String serviceName, String userId); + + /** + * List of all user identities. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Users Identity list representation. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String userId, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityCollection.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityCollection.java new file mode 100644 index 0000000000000..fe55290a985e3 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityCollection.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.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Users Identity list representation. */ +@Fluent +public final class UserIdentityCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentityCollection.class); + + /* + * User Identity values. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Total record count number across all pages. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * Next page link if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: User Identity values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: User Identity values. + * + * @param value the value value to set. + * @return the UserIdentityCollection object itself. + */ + public UserIdentityCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the count property: Total record count number across all pages. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: Total record count number across all pages. + * + * @param count the count value to set. + * @return the UserIdentityCollection object itself. + */ + public UserIdentityCollection withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the nextLink property: Next page link if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page link if any. + * + * @param nextLink the nextLink value to set. + * @return the UserIdentityCollection object itself. + */ + public UserIdentityCollection 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/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityContract.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityContract.java new file mode 100644 index 0000000000000..4d24023335743 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityContract.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.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; + +/** An immutable client-side representation of UserIdentityContract. */ +public interface UserIdentityContract { + /** + * Gets the provider property: Identity provider name. + * + * @return the provider value. + */ + String provider(); + + /** + * Gets the id property: Identifier value within provider. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner object. + * + * @return the inner object. + */ + UserIdentityContractInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityProperties.java new file mode 100644 index 0000000000000..11f174019f281 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserIdentityProperties.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.apimanagement.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 UserIdentityProperties model. */ +@Fluent +public final class UserIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentityProperties.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client id of user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserState.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserState.java new file mode 100644 index 0000000000000..938c4ef238cf6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserState.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UserState. */ +public final class UserState extends ExpandableStringEnum { + /** Static value active for UserState. */ + public static final UserState ACTIVE = fromString("active"); + + /** Static value blocked for UserState. */ + public static final UserState BLOCKED = fromString("blocked"); + + /** Static value pending for UserState. */ + public static final UserState PENDING = fromString("pending"); + + /** Static value deleted for UserState. */ + public static final UserState DELETED = fromString("deleted"); + + /** + * Creates or finds a UserState from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserState. + */ + @JsonCreator + public static UserState fromString(String name) { + return fromString(name, UserState.class); + } + + /** @return known UserState values. */ + public static Collection values() { + return values(UserState.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptions.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptions.java new file mode 100644 index 0000000000000..28f988d989bc4 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptions.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.apimanagement.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 UserSubscriptions. */ +public interface UserSubscriptions { + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + PagedIterable list(String resourceGroupName, String serviceName, String userId); + + /** + * Lists the collection of subscriptions of the specified user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|------------------------|-----------------------------------|</br>|name | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|displayName | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|stateComment | + * filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|ownerId | filter | + * ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|scope | filter | ge, le, + * eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>|userId | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>|productId | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Subscriptions list representation. + */ + PagedIterable list( + String resourceGroupName, + String serviceName, + String userId, + String filter, + Integer top, + Integer skip, + Context context); + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + SubscriptionContract get(String resourceGroupName, String serviceName, String userId, String sid); + + /** + * Gets the specified Subscription entity associated with a particular user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param sid Subscription entity Identifier. The entity represents the association between a user and a product in + * API Management. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Subscription entity associated with a particular user. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String userId, String sid, Context context); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetHeaders.java new file mode 100644 index 0000000000000..d19be03e42ba9 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetHeaders.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.apimanagement.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 UserSubscriptionsGetHeaders model. */ +@Fluent +public final class UserSubscriptionsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserSubscriptionsGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the UserSubscriptionsGetHeaders object itself. + */ + public UserSubscriptionsGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetResponse.java new file mode 100644 index 0000000000000..6584d7ade9dfc --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserSubscriptionsGetResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractInner; + +/** Contains all response data for the get operation. */ +public final class UserSubscriptionsGetResponse + extends ResponseBase { + /** + * Creates an instance of UserSubscriptionsGetResponse. + * + * @param request the request which resulted in this UserSubscriptionsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public UserSubscriptionsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SubscriptionContractInner value, + UserSubscriptionsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SubscriptionContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenParameters.java new file mode 100644 index 0000000000000..b709c0ba39b24 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenParameters.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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.time.OffsetDateTime; + +/** Get User Token parameters. */ +@JsonFlatten +@Fluent +public class UserTokenParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserTokenParameters.class); + + /* + * The Key to be used to generate token for user. + */ + @JsonProperty(value = "properties.keyType") + private KeyType keyType; + + /* + * The Expiry time of the Token. Maximum token expiry time is set to 30 + * days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` + * as specified by the ISO 8601 standard. + * + */ + @JsonProperty(value = "properties.expiry") + private OffsetDateTime expiry; + + /** + * Get the keyType property: The Key to be used to generate token for user. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The Key to be used to generate token for user. + * + * @param keyType the keyType value to set. + * @return the UserTokenParameters object itself. + */ + public UserTokenParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get the expiry property: The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date + * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + * + * @param expiry the expiry value to set. + * @return the UserTokenParameters object itself. + */ + public UserTokenParameters withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenResult.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenResult.java new file mode 100644 index 0000000000000..abd8f5a3227a2 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserTokenResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.resourcemanager.apimanagement.fluent.models.UserTokenResultInner; + +/** An immutable client-side representation of UserTokenResult. */ +public interface UserTokenResult { + /** + * Gets the value property: Shared Access Authorization token for the User. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.apimanagement.fluent.models.UserTokenResultInner object. + * + * @return the inner object. + */ + UserTokenResultInner innerModel(); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParameters.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParameters.java new file mode 100644 index 0000000000000..e0ec9c13fde15 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParameters.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** User update parameters. */ +@JsonFlatten +@Fluent +public class UserUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdateParameters.class); + + /* + * Account state. Specifies whether the user is active or not. Blocked + * users are unable to sign into the developer portal or call any APIs of + * subscribed products. Default state is Active. + */ + @JsonProperty(value = "properties.state") + private UserState state; + + /* + * Optional note about a user set by the administrator. + */ + @JsonProperty(value = "properties.note") + private String note; + + /* + * Collection of user identities. + */ + @JsonProperty(value = "properties.identities") + private List identities; + + /* + * Email address. Must not be empty and must be unique within the service + * instance. + */ + @JsonProperty(value = "properties.email") + private String email; + + /* + * User Password. + */ + @JsonProperty(value = "properties.password") + private String password; + + /* + * First name. + */ + @JsonProperty(value = "properties.firstName") + private String firstName; + + /* + * Last name. + */ + @JsonProperty(value = "properties.lastName") + private String lastName; + + /** + * Get the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @return the state value. + */ + public UserState state() { + return this.state; + } + + /** + * Set the state property: Account state. Specifies whether the user is active or not. Blocked users are unable to + * sign into the developer portal or call any APIs of subscribed products. Default state is Active. + * + * @param state the state value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withState(UserState state) { + this.state = state; + return this; + } + + /** + * Get the note property: Optional note about a user set by the administrator. + * + * @return the note value. + */ + public String note() { + return this.note; + } + + /** + * Set the note property: Optional note about a user set by the administrator. + * + * @param note the note value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withNote(String note) { + this.note = note; + return this; + } + + /** + * Get the identities property: Collection of user identities. + * + * @return the identities value. + */ + public List identities() { + return this.identities; + } + + /** + * Set the identities property: Collection of user identities. + * + * @param identities the identities value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withIdentities(List identities) { + this.identities = identities; + return this; + } + + /** + * Get the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @param email the email value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the password property: User Password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: User Password. + * + * @param password the password value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the firstName property: First name. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name. + * + * @param firstName the firstName value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name. + * + * @param lastName the lastName value to set. + * @return the UserUpdateParameters object itself. + */ + public UserUpdateParameters withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identities() != null) { + identities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParametersProperties.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParametersProperties.java new file mode 100644 index 0000000000000..903b9f8fcbe98 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UserUpdateParametersProperties.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.apimanagement.fluent.models.UserIdentityContractInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters supplied to the Update User operation. */ +@Fluent +public final class UserUpdateParametersProperties extends UserEntityBaseParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserUpdateParametersProperties.class); + + /* + * Email address. Must not be empty and must be unique within the service + * instance. + */ + @JsonProperty(value = "email") + private String email; + + /* + * User Password. + */ + @JsonProperty(value = "password") + private String password; + + /* + * First name. + */ + @JsonProperty(value = "firstName") + private String firstName; + + /* + * Last name. + */ + @JsonProperty(value = "lastName") + private String lastName; + + /** + * Get the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email address. Must not be empty and must be unique within the service instance. + * + * @param email the email value to set. + * @return the UserUpdateParametersProperties object itself. + */ + public UserUpdateParametersProperties withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the password property: User Password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: User Password. + * + * @param password the password value to set. + * @return the UserUpdateParametersProperties object itself. + */ + public UserUpdateParametersProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the firstName property: First name. + * + * @return the firstName value. + */ + public String firstName() { + return this.firstName; + } + + /** + * Set the firstName property: First name. + * + * @param firstName the firstName value to set. + * @return the UserUpdateParametersProperties object itself. + */ + public UserUpdateParametersProperties withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get the lastName property: Last name. + * + * @return the lastName value. + */ + public String lastName() { + return this.lastName; + } + + /** + * Set the lastName property: Last name. + * + * @param lastName the lastName value to set. + * @return the UserUpdateParametersProperties object itself. + */ + public UserUpdateParametersProperties withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** {@inheritDoc} */ + @Override + public UserUpdateParametersProperties withState(UserState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserUpdateParametersProperties withNote(String note) { + super.withNote(note); + return this; + } + + /** {@inheritDoc} */ + @Override + public UserUpdateParametersProperties withIdentities(List identities) { + super.withIdentities(identities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Users.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Users.java new file mode 100644 index 0000000000000..51157b0335012 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Users.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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 Users. */ +public interface Users { + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + PagedIterable listByService(String resourceGroupName, String serviceName); + + /** + * Lists a collection of registered users in the specified service instance. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param filter | Field | Usage | Supported operators | Supported functions + * |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, + * ne, gt, lt | substringof, contains, startswith, endswith |</br>| firstName | filter | ge, le, eq, ne, + * gt, lt | substringof, contains, startswith, endswith |</br>| lastName | filter | ge, le, eq, ne, gt, lt + * | substringof, contains, startswith, endswith |</br>| email | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| state | filter | eq | |</br>| + * registrationDate | filter | ge, le, eq, ne, gt, lt | |</br>| note | filter | ge, le, eq, ne, gt, lt | + * substringof, contains, startswith, endswith |</br>| groups | expand | | |</br>. + * @param top Number of records to return. + * @param skip Number of records to skip. + * @param expandGroups Detailed Group in response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged Users list representation. + */ + PagedIterable listByService( + String resourceGroupName, + String serviceName, + String filter, + Integer top, + Integer skip, + Boolean expandGroups, + Context context); + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 getEntityTag(String resourceGroupName, String serviceName, String userId); + + /** + * Gets the entity state (Etag) version of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entity state (Etag) version of the user specified by its identifier. + */ + Response getEntityTagWithResponse( + String resourceGroupName, String serviceName, String userId, Context context); + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + UserContract get(String resourceGroupName, String serviceName, String userId); + + /** + * Gets the details of the user specified by its identifier. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String userId, Context context); + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String userId, String ifMatch); + + /** + * Deletes specific user. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String serviceName, + String userId, + String ifMatch, + Boolean deleteSubscriptions, + Boolean notify, + AppType appType, + Context context); + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + GenerateSsoUrlResult generateSsoUrl(String resourceGroupName, String serviceName, String userId); + + /** + * Retrieves a redirection URL containing an authentication token for signing a given user into the developer + * portal. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return generate SSO Url operations response details. + */ + Response generateSsoUrlWithResponse( + String resourceGroupName, String serviceName, String userId, Context context); + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + UserTokenResult getSharedAccessToken( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters); + + /** + * Gets the Shared Access Authorization Token for the User. + * + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param userId User identifier. Must be unique in the current API Management service instance. + * @param parameters Create Authorization Token parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Shared Access Authorization Token for the User. + */ + Response getSharedAccessTokenWithResponse( + String resourceGroupName, String serviceName, String userId, UserTokenParameters parameters, Context context); + + /** + * Gets the details of the user specified by its identifier. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + UserContract getById(String id); + + /** + * Gets the details of the user specified by its identifier. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the user specified by its identifier. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specific user. + * + * @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 specific user. + * + * @param id the resource ID. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET + * request or it should be * for unconditional update. + * @param deleteSubscriptions Whether to delete user's subscription or not. + * @param notify Send an Account Closed Email notification to the User. + * @param appType Determines the type of application which send the create user request. Default is legacy publisher + * portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse( + String id, String ifMatch, Boolean deleteSubscriptions, Boolean notify, AppType appType, Context context); + + /** + * Begins definition for a new UserContract resource. + * + * @param name resource name. + * @return the first stage of the new UserContract definition. + */ + UserContract.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..e1f1af883ca80 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateHeaders.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.apimanagement.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 UsersCreateOrUpdateHeaders model. */ +@Fluent +public final class UsersCreateOrUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersCreateOrUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the UsersCreateOrUpdateHeaders object itself. + */ + public UsersCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..02c0842eca1cf --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersCreateOrUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class UsersCreateOrUpdateResponse extends ResponseBase { + /** + * Creates an instance of UsersCreateOrUpdateResponse. + * + * @param request the request which resulted in this UsersCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public UsersCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + UserContractInner value, + UsersCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public UserContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagHeaders.java new file mode 100644 index 0000000000000..e9ad93e3b9fad --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagHeaders.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.apimanagement.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 UsersGetEntityTagHeaders model. */ +@Fluent +public final class UsersGetEntityTagHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersGetEntityTagHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the UsersGetEntityTagHeaders object itself. + */ + public UsersGetEntityTagHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagResponse.java new file mode 100644 index 0000000000000..1e5bfb8b548ec --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetEntityTagResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getEntityTag operation. */ +public final class UsersGetEntityTagResponse extends ResponseBase { + /** + * Creates an instance of UsersGetEntityTagResponse. + * + * @param request the request which resulted in this UsersGetEntityTagResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public UsersGetEntityTagResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, UsersGetEntityTagHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetHeaders.java new file mode 100644 index 0000000000000..9c73d67eef979 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetHeaders.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.apimanagement.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 UsersGetHeaders model. */ +@Fluent +public final class UsersGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersGetHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the UsersGetHeaders object itself. + */ + public UsersGetHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetResponse.java new file mode 100644 index 0000000000000..31743ee455e3c --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersGetResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; + +/** Contains all response data for the get operation. */ +public final class UsersGetResponse extends ResponseBase { + /** + * Creates an instance of UsersGetResponse. + * + * @param request the request which resulted in this UsersGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public UsersGetResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, UserContractInner value, UsersGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public UserContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateHeaders.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateHeaders.java new file mode 100644 index 0000000000000..8f4526032b8e6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateHeaders.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.apimanagement.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 UsersUpdateHeaders model. */ +@Fluent +public final class UsersUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersUpdateHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the UsersUpdateHeaders object itself. + */ + public UsersUpdateHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateResponse.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateResponse.java new file mode 100644 index 0000000000000..83a0b7f119267 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/UsersUpdateResponse.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.apimanagement.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apimanagement.fluent.models.UserContractInner; + +/** Contains all response data for the update operation. */ +public final class UsersUpdateResponse extends ResponseBase { + /** + * Creates an instance of UsersUpdateResponse. + * + * @param request the request which resulted in this UsersUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public UsersUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + UserContractInner value, + UsersUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public UserContractInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Verbosity.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Verbosity.java new file mode 100644 index 0000000000000..696edbf36935a --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/Verbosity.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Verbosity. */ +public final class Verbosity extends ExpandableStringEnum { + /** Static value verbose for Verbosity. */ + public static final Verbosity VERBOSE = fromString("verbose"); + + /** Static value information for Verbosity. */ + public static final Verbosity INFORMATION = fromString("information"); + + /** Static value error for Verbosity. */ + public static final Verbosity ERROR = fromString("error"); + + /** + * Creates or finds a Verbosity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Verbosity. + */ + @JsonCreator + public static Verbosity fromString(String name) { + return fromString(name, Verbosity.class); + } + + /** @return known Verbosity values. */ + public static Collection values() { + return values(Verbosity.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VersioningScheme.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VersioningScheme.java new file mode 100644 index 0000000000000..eb906e69fdee6 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VersioningScheme.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VersioningScheme. */ +public final class VersioningScheme extends ExpandableStringEnum { + /** Static value Segment for VersioningScheme. */ + public static final VersioningScheme SEGMENT = fromString("Segment"); + + /** Static value Query for VersioningScheme. */ + public static final VersioningScheme QUERY = fromString("Query"); + + /** Static value Header for VersioningScheme. */ + public static final VersioningScheme HEADER = fromString("Header"); + + /** + * Creates or finds a VersioningScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding VersioningScheme. + */ + @JsonCreator + public static VersioningScheme fromString(String name) { + return fromString(name, VersioningScheme.class); + } + + /** @return known VersioningScheme values. */ + public static Collection values() { + return values(VersioningScheme.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkConfiguration.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkConfiguration.java new file mode 100644 index 0000000000000..6c1daa3cc4cbe --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkConfiguration.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apimanagement.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; + +/** Configuration of a virtual network to which API Management service is deployed. */ +@Fluent +public final class VirtualNetworkConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkConfiguration.class); + + /* + * The virtual network ID. This is typically a GUID. Expect a null GUID by + * default. + */ + @JsonProperty(value = "vnetid", access = JsonProperty.Access.WRITE_ONLY) + private String vnetid; + + /* + * The name of the subnet. + */ + @JsonProperty(value = "subnetname", access = JsonProperty.Access.WRITE_ONLY) + private String subnetname; + + /* + * The full resource ID of a subnet in a virtual network to deploy the API + * Management service in. + */ + @JsonProperty(value = "subnetResourceId") + private String subnetResourceId; + + /** + * Get the vnetid property: The virtual network ID. This is typically a GUID. Expect a null GUID by default. + * + * @return the vnetid value. + */ + public String vnetid() { + return this.vnetid; + } + + /** + * Get the subnetname property: The name of the subnet. + * + * @return the subnetname value. + */ + public String subnetname() { + return this.subnetname; + } + + /** + * Get the subnetResourceId property: The full resource ID of a subnet in a virtual network to deploy the API + * Management service in. + * + * @return the subnetResourceId value. + */ + public String subnetResourceId() { + return this.subnetResourceId; + } + + /** + * Set the subnetResourceId property: The full resource ID of a subnet in a virtual network to deploy the API + * Management service in. + * + * @param subnetResourceId the subnetResourceId value to set. + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withSubnetResourceId(String subnetResourceId) { + this.subnetResourceId = subnetResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkType.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkType.java new file mode 100644 index 0000000000000..b9ef2d11171d7 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/VirtualNetworkType.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.apimanagement.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VirtualNetworkType. */ +public final class VirtualNetworkType extends ExpandableStringEnum { + /** Static value None for VirtualNetworkType. */ + public static final VirtualNetworkType NONE = fromString("None"); + + /** Static value External for VirtualNetworkType. */ + public static final VirtualNetworkType EXTERNAL = fromString("External"); + + /** Static value Internal for VirtualNetworkType. */ + public static final VirtualNetworkType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a VirtualNetworkType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkType. + */ + @JsonCreator + public static VirtualNetworkType fromString(String name) { + return fromString(name, VirtualNetworkType.class); + } + + /** @return known VirtualNetworkType values. */ + public static Collection values() { + return values(VirtualNetworkType.class); + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/X509CertificateName.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/X509CertificateName.java new file mode 100644 index 0000000000000..54a4cf912d73d --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/X509CertificateName.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.apimanagement.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; + +/** Properties of server X509Names. */ +@Fluent +public final class X509CertificateName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(X509CertificateName.class); + + /* + * Common Name of the Certificate. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Thumbprint for the Issuer of the Certificate. + */ + @JsonProperty(value = "issuerCertificateThumbprint") + private String issuerCertificateThumbprint; + + /** + * Get the name property: Common Name of the Certificate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Common Name of the Certificate. + * + * @param name the name value to set. + * @return the X509CertificateName object itself. + */ + public X509CertificateName withName(String name) { + this.name = name; + return this; + } + + /** + * Get the issuerCertificateThumbprint property: Thumbprint for the Issuer of the Certificate. + * + * @return the issuerCertificateThumbprint value. + */ + public String issuerCertificateThumbprint() { + return this.issuerCertificateThumbprint; + } + + /** + * Set the issuerCertificateThumbprint property: Thumbprint for the Issuer of the Certificate. + * + * @param issuerCertificateThumbprint the issuerCertificateThumbprint value to set. + * @return the X509CertificateName object itself. + */ + public X509CertificateName withIssuerCertificateThumbprint(String issuerCertificateThumbprint) { + this.issuerCertificateThumbprint = issuerCertificateThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/package-info.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/models/package-info.java new file mode 100644 index 0000000000000..1b2ffc8455194 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/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 ApiManagementClient. ApiManagement Client. */ +package com.azure.resourcemanager.apimanagement.models; diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/package-info.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/package-info.java new file mode 100644 index 0000000000000..021d5ea8bcde5 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/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 ApiManagementClient. ApiManagement Client. */ +package com.azure.resourcemanager.apimanagement; diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/module-info.java b/sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/module-info.java new file mode 100644 index 0000000000000..1f2dc7190e234 --- /dev/null +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/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.apimanagement { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.apimanagement; + exports com.azure.resourcemanager.apimanagement.fluent; + exports com.azure.resourcemanager.apimanagement.fluent.models; + exports com.azure.resourcemanager.apimanagement.models; + + opens com.azure.resourcemanager.apimanagement.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.apimanagement.models to + com.azure.core, + com.fasterxml.jackson.databind; +}