diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/CHANGELOG.md b/sdk/apicenter/azure-resourcemanager-apicenter/CHANGELOG.md index 08bdcaedf759..1e9ccf91c35b 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/CHANGELOG.md +++ b/sdk/apicenter/azure-resourcemanager-apicenter/CHANGELOG.md @@ -1,14 +1,75 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-10) + +- Azure Resource Manager ApiCenter client library for Java. This package contains Microsoft Azure SDK for ApiCenter Management SDK. Azure API Center Resource Provider. Package tag package-2024-06-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.ApiSource` was added + +* `models.ApiSourceLinkState` was added + +* `models.ApiSourcesGetResponse` was added + +* `models.ServiceUpdateProperties` was added + +* `models.DeletedServiceListResult` was added + +* `models.ApiSourcesGetHeaders` was added + +* `models.ApiSourceProperties` was added + +* `models.ImportSpecificationOptions` was added + +* `models.ApiSourceListResult` was added + +* `models.ApiSourcesCreateOrUpdateResponse` was added + +* `models.ApiSource$Definition` was added + +* `models.DeletedServiceProperties` was added + +* `models.ApiSourcesCreateOrUpdateHeaders` was added + +* `models.DeletedServicesGetByResourceGroupHeaders` was added + +* `models.DeletedServices` was added + +* `models.DeletedService` was added -### Bugs Fixed +* `models.DeletedServicesGetByResourceGroupResponse` was added + +* `models.AzureApiManagementSource` was added + +* `models.LinkState` was added + +* `models.ApiSource$DefinitionStages` was added + +* `models.ApiSource$UpdateStages` was added + +* `models.ApiSources` was added + +* `models.ApiSource$Update` was added + +#### `models.ServiceUpdate` was modified + +* `withProperties(models.ServiceUpdateProperties)` was added +* `properties()` was added + +#### `models.Service$Update` was modified + +* `withProperties(models.ServiceUpdateProperties)` was added + +#### `models.ServiceProperties` was modified + +* `withRestore(java.lang.Boolean)` was added +* `restore()` was added + +#### `ApiCenterManager` was modified -### Other Changes +* `apiSources()` was added +* `deletedServices()` was added ## 1.1.0 (2024-12-13) diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/README.md b/sdk/apicenter/azure-resourcemanager-apicenter/README.md index 651eae7b5027..59231b61f42a 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/README.md +++ b/sdk/apicenter/azure-resourcemanager-apicenter/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ApiCenter client library for Java. -This package contains Microsoft Azure SDK for ApiCenter Management SDK. Azure API Center Resource Provider. Package tag package-2024-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ApiCenter Management SDK. Azure API Center Resource Provider. Package tag package-2024-06-01-preview. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ ApiCenterManager manager = ApiCenterManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -107,5 +107,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/SAMPLE.md b/sdk/apicenter/azure-resourcemanager-apicenter/SAMPLE.md index d53b754d2c2f..2d94a2b5a6f8 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/SAMPLE.md +++ b/sdk/apicenter/azure-resourcemanager-apicenter/SAMPLE.md @@ -11,6 +11,14 @@ - [ImportSpecification](#apidefinitions_importspecification) - [List](#apidefinitions_list) +## ApiSources + +- [CreateOrUpdate](#apisources_createorupdate) +- [Delete](#apisources_delete) +- [Get](#apisources_get) +- [Head](#apisources_head) +- [List](#apisources_list) + ## ApiVersions - [CreateOrUpdate](#apiversions_createorupdate) @@ -27,6 +35,13 @@ - [Head](#apis_head) - [List](#apis_list) +## DeletedServices + +- [Delete](#deletedservices_delete) +- [GetByResourceGroup](#deletedservices_getbyresourcegroup) +- [List](#deletedservices_list) +- [ListByResourceGroup](#deletedservices_listbyresourcegroup) + ## Deployments - [CreateOrUpdate](#deployments_createorupdate) @@ -80,7 +95,8 @@ */ public final class ApiDefinitionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiDefinitions_CreateOrUpdate.json */ /** @@ -106,8 +122,8 @@ public final class ApiDefinitionsCreateOrUpdateSamples { public final class ApiDefinitionsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Delete. - * json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_Delete.json */ /** * Sample code: ApiDefinitions_Delete. @@ -130,7 +146,8 @@ public final class ApiDefinitionsDeleteSamples { */ public final class ApiDefinitionsExportSpecificationSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiDefinitions_ExportSpecification.json */ /** @@ -155,7 +172,8 @@ public final class ApiDefinitionsExportSpecificationSamples { public final class ApiDefinitionsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_Get.json */ /** * Sample code: ApiDefinitions_Get. @@ -179,7 +197,8 @@ public final class ApiDefinitionsGetSamples { public final class ApiDefinitionsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_Head.json */ /** * Sample code: ApiDefinitions_Head. @@ -203,7 +222,8 @@ public final class ApiDefinitionsHeadSamples { */ public final class ApiDefinitionsImportSpecificationSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiDefinitions_ImportSpecification.json */ /** @@ -228,7 +248,8 @@ public final class ApiDefinitionsImportSpecificationSamples { public final class ApiDefinitionsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_List.json */ /** * Sample code: ApiDefinitions_ListByApiVersion. @@ -243,6 +264,143 @@ public final class ApiDefinitionsListSamples { } ``` +### ApiSources_CreateOrUpdate + +```java +import com.azure.resourcemanager.apicenter.models.ApiSourceProperties; +import com.azure.resourcemanager.apicenter.models.AzureApiManagementSource; +import com.azure.resourcemanager.apicenter.models.ImportSpecificationOptions; +import com.azure.resourcemanager.apicenter.models.LifecycleStage; + +/** + * Samples for ApiSources CreateOrUpdate. + */ +public final class ApiSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiSources_CreateOrUpdate.json + */ + /** + * Sample code: ApiSources_CreateOrUpdate. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesCreateOrUpdate(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .define("contoso-api-management") + .withExistingWorkspace("contoso-resources", "contoso", "default") + .withProperties(new ApiSourceProperties().withImportSpecification(ImportSpecificationOptions.ONDEMAND) + .withAzureApiManagementSource(new AzureApiManagementSource().withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso") + .withMsiResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity")) + .withTargetEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/azure-api-management") + .withTargetLifecycleStage(LifecycleStage.DESIGN)) + .create(); + } +} +``` + +### ApiSources_Delete + +```java +/** + * Samples for ApiSources Delete. + */ +public final class ApiSourcesDeleteSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiSources_Delete.json + */ + /** + * Sample code: ApiSources_Delete. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesDelete(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .deleteWithResponse("contoso-resources", "contoso", "default", "contoso-api-management", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiSources_Get + +```java +/** + * Samples for ApiSources Get. + */ +public final class ApiSourcesGetSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiSources_Get. + * json + */ + /** + * Sample code: ApiSources_Get. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesGet(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .getWithResponse("contoso-resources", "contoso", "default", "contoso-api-management", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiSources_Head + +```java +/** + * Samples for ApiSources Head. + */ +public final class ApiSourcesHeadSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiSources_Head. + * json + */ + /** + * Sample code: ApiSources_Head. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesHead(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .headWithResponse("contoso-resources", "contoso", "default", "contoso-api-management", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiSources_List + +```java +/** + * Samples for ApiSources List. + */ +public final class ApiSourcesListSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiSources_List. + * json + */ + /** + * Sample code: ApiSources_ListByWorkspace. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesListByWorkspace(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources().list("contoso-resources", "contoso", "default", null, com.azure.core.util.Context.NONE); + } +} +``` + ### ApiVersions_CreateOrUpdate ```java @@ -251,7 +409,8 @@ public final class ApiDefinitionsListSamples { */ public final class ApiVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiVersions_CreateOrUpdate.json */ /** @@ -277,7 +436,8 @@ public final class ApiVersionsCreateOrUpdateSamples { public final class ApiVersionsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiVersions_Delete.json */ /** * Sample code: ApiVersions_Delete. @@ -301,7 +461,8 @@ public final class ApiVersionsDeleteSamples { public final class ApiVersionsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiVersions_Get. + * json */ /** * Sample code: ApiVersions_Get. @@ -325,7 +486,8 @@ public final class ApiVersionsGetSamples { public final class ApiVersionsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiVersions_Head + * .json */ /** * Sample code: ApiVersions_Head. @@ -349,7 +511,8 @@ public final class ApiVersionsHeadSamples { public final class ApiVersionsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiVersions_List + * .json */ /** * Sample code: ApiVersions_ListByApi. @@ -372,7 +535,8 @@ public final class ApiVersionsListSamples { public final class ApisCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_CreateOrUpdate.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Apis_CreateOrUpdate.json */ /** * Sample code: Apis_CreateOrUpdate. @@ -394,7 +558,7 @@ public final class ApisCreateOrUpdateSamples { public final class ApisDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_Delete.json */ /** * Sample code: Apis_Delete. @@ -418,7 +582,7 @@ public final class ApisDeleteSamples { public final class ApisGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_Get.json */ /** * Sample code: Apis_Get. @@ -441,7 +605,7 @@ public final class ApisGetSamples { public final class ApisHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_Head.json */ /** * Sample code: Apis_Head. @@ -464,7 +628,7 @@ public final class ApisHeadSamples { public final class ApisListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_List.json */ /** * Sample code: Apis_ListByWorkspace. @@ -477,6 +641,100 @@ public final class ApisListSamples { } ``` +### DeletedServices_Delete + +```java +/** + * Samples for DeletedServices Delete. + */ +public final class DeletedServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_Delete.json + */ + /** + * Sample code: DeletedServices_Delete. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesDelete(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices() + .deleteByResourceGroupWithResponse("contoso-resources", "contoso", com.azure.core.util.Context.NONE); + } +} +``` + +### DeletedServices_GetByResourceGroup + +```java +/** + * Samples for DeletedServices GetByResourceGroup. + */ +public final class DeletedServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_Get.json + */ + /** + * Sample code: DeletedServices_Get. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesGet(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices() + .getByResourceGroupWithResponse("contoso-resources", "contoso", com.azure.core.util.Context.NONE); + } +} +``` + +### DeletedServices_List + +```java +/** + * Samples for DeletedServices List. + */ +public final class DeletedServicesListSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_List.json + */ + /** + * Sample code: DeletedServices_ListBySubscription. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesListBySubscription(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DeletedServices_ListByResourceGroup + +```java +/** + * Samples for DeletedServices ListByResourceGroup. + */ +public final class DeletedServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_ListBySubscription.json + */ + /** + * Sample code: DeletedServices_List. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesList(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices().listByResourceGroup("contoso-resources", null, com.azure.core.util.Context.NONE); + } +} +``` + ### Deployments_CreateOrUpdate ```java @@ -485,7 +743,8 @@ public final class ApisListSamples { */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Deployments_CreateOrUpdate.json */ /** @@ -511,7 +770,8 @@ public final class DeploymentsCreateOrUpdateSamples { public final class DeploymentsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Deployments_Delete.json */ /** * Sample code: Deployments_Delete. @@ -535,7 +795,8 @@ public final class DeploymentsDeleteSamples { public final class DeploymentsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Deployments_Get. + * json */ /** * Sample code: Deployments_Get. @@ -559,7 +820,8 @@ public final class DeploymentsGetSamples { public final class DeploymentsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Deployments_Head + * .json */ /** * Sample code: Deployments_Head. @@ -583,7 +845,8 @@ public final class DeploymentsHeadSamples { public final class DeploymentsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Deployments_List + * .json */ /** * Sample code: Deployments_ListByApi. @@ -605,7 +868,8 @@ public final class DeploymentsListSamples { */ public final class EnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Environments_CreateOrUpdate.json */ /** @@ -631,7 +895,8 @@ public final class EnvironmentsCreateOrUpdateSamples { public final class EnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Environments_Delete.json */ /** * Sample code: Environments_Delete. @@ -654,7 +919,8 @@ public final class EnvironmentsDeleteSamples { public final class EnvironmentsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Environments_Get + * .json */ /** * Sample code: Environments_Get. @@ -677,7 +943,8 @@ public final class EnvironmentsGetSamples { public final class EnvironmentsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Environments_Head.json */ /** * Sample code: Environments_Head. @@ -700,7 +967,8 @@ public final class EnvironmentsHeadSamples { public final class EnvironmentsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Environments_List.json */ /** * Sample code: Environments_ListByWorkspace. @@ -721,7 +989,8 @@ public final class EnvironmentsListSamples { */ public final class MetadataSchemasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * MetadataSchemas_CreateOrUpdate.json */ /** @@ -744,8 +1013,8 @@ public final class MetadataSchemasCreateOrUpdateSamples { public final class MetadataSchemasDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Delete. - * json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_Delete.json */ /** * Sample code: MetadataSchemas_Delete. @@ -768,7 +1037,8 @@ public final class MetadataSchemasDeleteSamples { public final class MetadataSchemasGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_Get.json */ /** * Sample code: MetadataSchemas_Get. @@ -791,7 +1061,8 @@ public final class MetadataSchemasGetSamples { public final class MetadataSchemasHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_Head.json */ /** * Sample code: MetadataSchemas_Head. @@ -814,7 +1085,8 @@ public final class MetadataSchemasHeadSamples { public final class MetadataSchemasListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_List.json */ /** * Sample code: MetadataSchemas_ListByService. @@ -836,7 +1108,8 @@ public final class MetadataSchemasListSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Operations_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Operations_List. + * json */ /** * Sample code: List Provider Operations. @@ -865,8 +1138,8 @@ import java.util.Map; public final class ServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_CreateOrUpdate. - * json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Services_CreateOrUpdate.json */ /** * Sample code: Services_CreateOrUpdate. @@ -911,7 +1184,8 @@ public final class ServicesCreateOrUpdateSamples { public final class ServicesDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Services_Delete. + * json */ /** * Sample code: Services_Delete. @@ -934,7 +1208,8 @@ public final class ServicesDeleteSamples { */ public final class ServicesExportMetadataSchemaSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Services_ExportMetadataSchema.json */ /** @@ -957,7 +1232,8 @@ public final class ServicesExportMetadataSchemaSamples { public final class ServicesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Services_Get. + * json */ /** * Sample code: Services_Get. @@ -979,7 +1255,8 @@ public final class ServicesGetByResourceGroupSamples { */ public final class ServicesListSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Services_ListBySubscription.json */ /** @@ -1001,7 +1278,8 @@ public final class ServicesListSamples { */ public final class ServicesListByResourceGroupSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Services_ListByResourceGroup.json */ /** @@ -1026,7 +1304,8 @@ import com.azure.resourcemanager.apicenter.models.Service; public final class ServicesUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Update.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Services_Update. + * json */ /** * Sample code: Services_Update. @@ -1051,8 +1330,8 @@ public final class ServicesUpdateSamples { public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_CreateOrUpdate - * .json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Workspaces_CreateOrUpdate.json */ /** * Sample code: Workspaces_CreateOrUpdate. @@ -1074,7 +1353,8 @@ public final class WorkspacesCreateOrUpdateSamples { public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Workspaces_Delete.json */ /** * Sample code: Workspaces_Delete. @@ -1097,7 +1377,8 @@ public final class WorkspacesDeleteSamples { public final class WorkspacesGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Workspaces_Get. + * json */ /** * Sample code: Workspaces_Get. @@ -1120,7 +1401,8 @@ public final class WorkspacesGetSamples { public final class WorkspacesHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Workspaces_Head. + * json */ /** * Sample code: Workspaces_Head. @@ -1143,7 +1425,8 @@ public final class WorkspacesHeadSamples { public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Workspaces_List. + * json */ /** * Sample code: Workspaces_ListByService. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml index 6c74eba357f5..9868dfd8abc3 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml +++ b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for ApiCenter Management - This package contains Microsoft Azure SDK for ApiCenter Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure API Center Resource Provider. Package tag package-2024-03. + This package contains Microsoft Azure SDK for ApiCenter Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure API Center Resource Provider. Package tag package-2024-06-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true false diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java index 338f4ad2167e..a7c90528ce7b 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/ApiCenterManager.java @@ -22,12 +22,15 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.apicenter.fluent.AzureApiCenter; import com.azure.resourcemanager.apicenter.implementation.ApiDefinitionsImpl; +import com.azure.resourcemanager.apicenter.implementation.ApiSourcesImpl; import com.azure.resourcemanager.apicenter.implementation.ApiVersionsImpl; import com.azure.resourcemanager.apicenter.implementation.ApisImpl; import com.azure.resourcemanager.apicenter.implementation.AzureApiCenterBuilder; +import com.azure.resourcemanager.apicenter.implementation.DeletedServicesImpl; import com.azure.resourcemanager.apicenter.implementation.DeploymentsImpl; import com.azure.resourcemanager.apicenter.implementation.EnvironmentsImpl; import com.azure.resourcemanager.apicenter.implementation.MetadataSchemasImpl; @@ -35,8 +38,10 @@ import com.azure.resourcemanager.apicenter.implementation.ServicesImpl; import com.azure.resourcemanager.apicenter.implementation.WorkspacesImpl; import com.azure.resourcemanager.apicenter.models.ApiDefinitions; +import com.azure.resourcemanager.apicenter.models.ApiSources; import com.azure.resourcemanager.apicenter.models.ApiVersions; import com.azure.resourcemanager.apicenter.models.Apis; +import com.azure.resourcemanager.apicenter.models.DeletedServices; import com.azure.resourcemanager.apicenter.models.Deployments; import com.azure.resourcemanager.apicenter.models.Environments; import com.azure.resourcemanager.apicenter.models.MetadataSchemas; @@ -47,6 +52,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -57,12 +63,16 @@ public final class ApiCenterManager { private Operations operations; + private DeletedServices deletedServices; + private Services services; private MetadataSchemas metadataSchemas; private Workspaces workspaces; + private ApiSources apiSources; + private Apis apis; private Deployments deployments; @@ -125,6 +135,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-apicenter.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -232,12 +245,14 @@ public ApiCenterManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.apicenter") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -295,6 +310,18 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of DeletedServices. + * + * @return Resource collection API of DeletedServices. + */ + public DeletedServices deletedServices() { + if (this.deletedServices == null) { + this.deletedServices = new DeletedServicesImpl(clientObject.getDeletedServices(), this); + } + return deletedServices; + } + /** * Gets the resource collection API of Services. It manages Service. * @@ -331,6 +358,18 @@ public Workspaces workspaces() { return workspaces; } + /** + * Gets the resource collection API of ApiSources. It manages ApiSource. + * + * @return Resource collection API of ApiSources. + */ + public ApiSources apiSources() { + if (this.apiSources == null) { + this.apiSources = new ApiSourcesImpl(clientObject.getApiSources(), this); + } + return apiSources; + } + /** * Gets the resource collection API of Apis. It manages Api. * diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiSourcesClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiSourcesClient.java new file mode 100644 index 000000000000..56f0e6f49202 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/ApiSourcesClient.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.apicenter.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.apicenter.fluent.models.ApiSourceInner; +import com.azure.resourcemanager.apicenter.models.ApiSourcesCreateOrUpdateResponse; +import com.azure.resourcemanager.apicenter.models.ApiSourcesGetResponse; + +/** + * An instance of this class provides access to all the operations defined in ApiSourcesClient. + */ +public interface ApiSourcesClient { + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 a ApiSource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String workspaceName); + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiSource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String workspaceName, + String filter, Context context); + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiSourcesGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context); + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiSourceInner get(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName); + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource create 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 source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiSourcesCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName, ApiSourceInner resource, Context context); + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource 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 source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiSourceInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, ApiSourceInner resource); + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context); + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String apiSourceName); + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context); + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 head(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName); +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java index cf61cbe99d7c..c34bcf6621fd 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/AzureApiCenter.java @@ -53,6 +53,13 @@ public interface AzureApiCenter { */ OperationsClient getOperations(); + /** + * Gets the DeletedServicesClient object to access its operations. + * + * @return the DeletedServicesClient object. + */ + DeletedServicesClient getDeletedServices(); + /** * Gets the ServicesClient object to access its operations. * @@ -74,6 +81,13 @@ public interface AzureApiCenter { */ WorkspacesClient getWorkspaces(); + /** + * Gets the ApiSourcesClient object to access its operations. + * + * @return the ApiSourcesClient object. + */ + ApiSourcesClient getApiSources(); + /** * Gets the ApisClient object to access its operations. * diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/DeletedServicesClient.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/DeletedServicesClient.java new file mode 100644 index 000000000000..d49bdd75f8ea --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/DeletedServicesClient.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apicenter.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.apicenter.fluent.models.DeletedServiceInner; +import com.azure.resourcemanager.apicenter.models.DeletedServicesGetByResourceGroupResponse; + +/** + * An instance of this class provides access to all the operations defined in DeletedServicesClient. + */ +public interface DeletedServicesClient { + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedServicesGetByResourceGroupResponse getByResourceGroupWithResponse(String resourceGroupName, + String deletedServiceName, Context context); + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedServiceInner getByResourceGroup(String resourceGroupName, String deletedServiceName); + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String deletedServiceName, Context context); + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 delete(String resourceGroupName, String deletedServiceName); +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiSourceInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiSourceInner.java new file mode 100644 index 000000000000..e42324f0c778 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/ApiSourceInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apicenter.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.apicenter.models.ApiSourceProperties; +import java.io.IOException; + +/** + * API source entity. + */ +@Fluent +public final class ApiSourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ApiSourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ApiSourceInner class. + */ + public ApiSourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ApiSourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ApiSourceInner object itself. + */ + public ApiSourceInner withProperties(ApiSourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiSourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiSourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiSourceInner. + */ + public static ApiSourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiSourceInner deserializedApiSourceInner = new ApiSourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiSourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApiSourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApiSourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedApiSourceInner.properties = ApiSourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedApiSourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiSourceInner; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/DeletedServiceInner.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/DeletedServiceInner.java new file mode 100644 index 000000000000..2813f5865c2f --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/fluent/models/DeletedServiceInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apicenter.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.apicenter.models.DeletedServiceProperties; +import java.io.IOException; + +/** + * Soft-deleted service entity. + */ +@Fluent +public final class DeletedServiceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DeletedServiceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DeletedServiceInner class. + */ + public DeletedServiceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DeletedServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DeletedServiceInner object itself. + */ + public DeletedServiceInner withProperties(DeletedServiceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedServiceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedServiceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeletedServiceInner. + */ + public static DeletedServiceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedServiceInner deserializedDeletedServiceInner = new DeletedServiceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeletedServiceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeletedServiceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeletedServiceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeletedServiceInner.properties = DeletedServiceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDeletedServiceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedServiceInner; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourceImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourceImpl.java new file mode 100644 index 000000000000..d4716b6c3508 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourceImpl.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.apicenter.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; +import com.azure.resourcemanager.apicenter.models.ApiSource; +import com.azure.resourcemanager.apicenter.models.ApiSourceProperties; + +public final class ApiSourceImpl implements ApiSource, ApiSource.Definition, ApiSource.Update { + private ApiSourceInner innerObject; + + private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ApiSourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApiSourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apicenter.ApiCenterManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String workspaceName; + + private String apiSourceName; + + public ApiSourceImpl withExistingWorkspace(String resourceGroupName, String serviceName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.workspaceName = workspaceName; + return this; + } + + public ApiSource create() { + this.innerObject = serviceManager.serviceClient() + .getApiSources() + .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ApiSource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiSources() + .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, this.innerModel(), + context) + .getValue(); + return this; + } + + ApiSourceImpl(String name, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) { + this.innerObject = new ApiSourceInner(); + this.serviceManager = serviceManager; + this.apiSourceName = name; + } + + public ApiSourceImpl update() { + return this; + } + + public ApiSource apply() { + this.innerObject = serviceManager.serviceClient() + .getApiSources() + .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ApiSource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiSources() + .createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, this.innerModel(), + context) + .getValue(); + return this; + } + + ApiSourceImpl(ApiSourceInner innerObject, com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "services"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.apiSourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apiSources"); + } + + public ApiSource refresh() { + this.innerObject = serviceManager.serviceClient() + .getApiSources() + .getWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, Context.NONE) + .getValue(); + return this; + } + + public ApiSource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiSources() + .getWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, context) + .getValue(); + return this; + } + + public ApiSourceImpl withProperties(ApiSourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourcesClientImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourcesClientImpl.java new file mode 100644 index 000000000000..d005d5e330ae --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourcesClientImpl.java @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apicenter.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.resourcemanager.apicenter.fluent.ApiSourcesClient; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; +import com.azure.resourcemanager.apicenter.models.ApiSourceListResult; +import com.azure.resourcemanager.apicenter.models.ApiSourcesCreateOrUpdateResponse; +import com.azure.resourcemanager.apicenter.models.ApiSourcesGetResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ApiSourcesClient. + */ +public final class ApiSourcesClientImpl implements ApiSourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApiSourcesService service; + + /** + * The service client containing this operation class. + */ + private final AzureApiCenterImpl client; + + /** + * Initializes an instance of ApiSourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiSourcesClientImpl(AzureApiCenterImpl client) { + this.service + = RestProxy.create(ApiSourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureApiCenterApiSources to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureApiCenterApiSou") + public interface ApiSourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apiSources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("workspaceName") String workspaceName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apiSources/{apiSourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("workspaceName") String workspaceName, @PathParam("apiSourceName") String apiSourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apiSources/{apiSourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("workspaceName") String workspaceName, @PathParam("apiSourceName") String apiSourceName, + @BodyParam("application/json") ApiSourceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apiSources/{apiSourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("workspaceName") String workspaceName, @PathParam("apiSourceName") String apiSourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Head("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apiSources/{apiSourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> head(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("workspaceName") String workspaceName, @PathParam("apiSourceName") String apiSourceName, + @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); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter 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 a ApiSource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String serviceName, + String workspaceName, String filter) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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(), resourceGroupName, serviceName, workspaceName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter 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 a ApiSource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String serviceName, + String workspaceName, 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 (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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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(), + resourceGroupName, serviceName, workspaceName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter 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 a ApiSource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName, + String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a ApiSource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter 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 a ApiSource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String workspaceName, + String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, workspaceName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a ApiSource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, filter)); + } + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter 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 a ApiSource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName, + String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, workspaceName, filter, context)); + } + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiSourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, workspaceName, apiSourceName, accept, context); + } + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName) { + return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiSourcesGetResponse getWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName, context).block(); + } + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiSourceInner get(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName) { + return getWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, Context.NONE).getValue(); + } + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource 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 source entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync(String resourceGroupName, + String serviceName, String workspaceName, String apiSourceName, ApiSourceInner resource) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiSourceName, resource, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource create 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 source entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync(String resourceGroupName, + String serviceName, String workspaceName, String apiSourceName, ApiSourceInner resource, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiSourceName, resource, + accept, context); + } + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource 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 source entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, ApiSourceInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource create 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 source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiSourcesCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName, ApiSourceInner resource, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName, resource, + context).block(); + } + + /** + * Creates new or updates existing API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @param resource Resource 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 source entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiSourceInner createOrUpdate(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, ApiSourceInner resource) { + return createOrUpdateWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, resource, + Context.NONE).getValue(); + } + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiSourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, workspaceName, apiSourceName, accept, context); + } + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName, context).block(); + } + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName) { + deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, Context.NONE); + } + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> headWithResponseAsync(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.head(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, workspaceName, apiSourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> headWithResponseAsync(String resourceGroupName, String serviceName, + String workspaceName, String apiSourceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (apiSourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiSourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.head(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, workspaceName, apiSourceName, accept, context); + } + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono headAsync(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName) { + return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context) { + return headWithResponseAsync(resourceGroupName, serviceName, workspaceName, apiSourceName, context).block(); + } + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void head(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName) { + headWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiSource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiSource list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourcesImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourcesImpl.java new file mode 100644 index 000000000000..29313e38d4c5 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ApiSourcesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apicenter.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.apicenter.fluent.ApiSourcesClient; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; +import com.azure.resourcemanager.apicenter.models.ApiSource; +import com.azure.resourcemanager.apicenter.models.ApiSources; +import com.azure.resourcemanager.apicenter.models.ApiSourcesGetResponse; + +public final class ApiSourcesImpl implements ApiSources { + private static final ClientLogger LOGGER = new ClientLogger(ApiSourcesImpl.class); + + private final ApiSourcesClient innerClient; + + private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager; + + public ApiSourcesImpl(ApiSourcesClient innerClient, + com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiSourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, String workspaceName, + String filter, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, serviceName, workspaceName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiSourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context) { + ApiSourcesGetResponse inner = this.serviceClient() + .getWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApiSourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiSource get(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName) { + ApiSourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, workspaceName, apiSourceName); + if (inner != null) { + return new ApiSourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, context); + } + + public void delete(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName) { + this.serviceClient().delete(resourceGroupName, serviceName, workspaceName, apiSourceName); + } + + public Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context) { + return this.serviceClient() + .headWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, context); + } + + public void head(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName) { + this.serviceClient().head(resourceGroupName, serviceName, workspaceName, apiSourceName); + } + + public ApiSource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String apiSourceName = ResourceManagerUtils.getValueFromIdByName(id, "apiSources"); + if (apiSourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiSources'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String apiSourceName = ResourceManagerUtils.getValueFromIdByName(id, "apiSources"); + if (apiSourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiSources'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String apiSourceName = ResourceManagerUtils.getValueFromIdByName(id, "apiSources"); + if (apiSourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiSources'.", id))); + } + this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String apiSourceName = ResourceManagerUtils.getValueFromIdByName(id, "apiSources"); + if (apiSourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiSources'.", id))); + } + return this.deleteWithResponse(resourceGroupName, serviceName, workspaceName, apiSourceName, context); + } + + private ApiSourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apicenter.ApiCenterManager manager() { + return this.serviceManager; + } + + public ApiSourceImpl define(String name) { + return new ApiSourceImpl(name, this.manager()); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java index 567a7d61374a..2d93ce4f3223 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/AzureApiCenterImpl.java @@ -24,9 +24,11 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.apicenter.fluent.ApiDefinitionsClient; +import com.azure.resourcemanager.apicenter.fluent.ApiSourcesClient; import com.azure.resourcemanager.apicenter.fluent.ApiVersionsClient; import com.azure.resourcemanager.apicenter.fluent.ApisClient; import com.azure.resourcemanager.apicenter.fluent.AzureApiCenter; +import com.azure.resourcemanager.apicenter.fluent.DeletedServicesClient; import com.azure.resourcemanager.apicenter.fluent.DeploymentsClient; import com.azure.resourcemanager.apicenter.fluent.EnvironmentsClient; import com.azure.resourcemanager.apicenter.fluent.MetadataSchemasClient; @@ -145,6 +147,20 @@ public OperationsClient getOperations() { return this.operations; } + /** + * 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 ServicesClient object to access its operations. */ @@ -187,6 +203,20 @@ public WorkspacesClient getWorkspaces() { return this.workspaces; } + /** + * The ApiSourcesClient object to access its operations. + */ + private final ApiSourcesClient apiSources; + + /** + * Gets the ApiSourcesClient object to access its operations. + * + * @return the ApiSourcesClient object. + */ + public ApiSourcesClient getApiSources() { + return this.apiSources; + } + /** * The ApisClient object to access its operations. */ @@ -274,11 +304,13 @@ public EnvironmentsClient getEnvironments() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-03-01"; + this.apiVersion = "2024-06-01-preview"; this.operations = new OperationsClientImpl(this); + this.deletedServices = new DeletedServicesClientImpl(this); this.services = new ServicesClientImpl(this); this.metadataSchemas = new MetadataSchemasClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); + this.apiSources = new ApiSourcesClientImpl(this); this.apis = new ApisClientImpl(this); this.deployments = new DeploymentsClientImpl(this); this.apiVersions = new ApiVersionsClientImpl(this); diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServiceImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServiceImpl.java new file mode 100644 index 000000000000..ea859252bfdf --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServiceImpl.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.apicenter.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner; +import com.azure.resourcemanager.apicenter.models.DeletedService; +import com.azure.resourcemanager.apicenter.models.DeletedServiceProperties; + +public final class DeletedServiceImpl implements DeletedService { + private DeletedServiceInner innerObject; + + private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager; + + DeletedServiceImpl(DeletedServiceInner innerObject, + com.azure.resourcemanager.apicenter.ApiCenterManager 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 DeletedServiceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DeletedServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.apicenter.ApiCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServicesClientImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServicesClientImpl.java new file mode 100644 index 000000000000..8902e7ba5306 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServicesClientImpl.java @@ -0,0 +1,728 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.apicenter.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.apicenter.fluent.DeletedServicesClient; +import com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner; +import com.azure.resourcemanager.apicenter.models.DeletedServiceListResult; +import com.azure.resourcemanager.apicenter.models.DeletedServicesGetByResourceGroupResponse; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final DeletedServicesService service; + + /** + * The service client containing this operation class. + */ + private final AzureApiCenterImpl client; + + /** + * Initializes an instance of DeletedServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeletedServicesClientImpl(AzureApiCenterImpl client) { + this.service + = RestProxy.create(DeletedServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureApiCenterDeletedServices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureApiCenterDelete") + public interface DeletedServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ApiCenter/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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/deletedServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/deletedServices/{deletedServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deletedServiceName") String deletedServiceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/deletedServices/{deletedServiceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deletedServiceName") String deletedServiceName, @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists 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 a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists 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 a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter 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 a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter 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 a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter 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 a DeletedService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a DeletedService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter 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 a DeletedService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); + } + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); + } + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + getByResourceGroupWithResponseAsync(String resourceGroupName, String deletedServiceName) { + 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 (deletedServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deletedServiceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + getByResourceGroupWithResponseAsync(String resourceGroupName, String deletedServiceName, 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 (deletedServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deletedServiceName, accept, context); + } + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String deletedServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deletedServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedServicesGetByResourceGroupResponse getByResourceGroupWithResponse(String resourceGroupName, + String deletedServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deletedServiceName, context).block(); + } + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedServiceInner getByResourceGroup(String resourceGroupName, String deletedServiceName) { + return getByResourceGroupWithResponse(resourceGroupName, deletedServiceName, Context.NONE).getValue(); + } + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String deletedServiceName) { + 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 (deletedServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deletedServiceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String deletedServiceName, + 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 (deletedServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deletedServiceName, accept, context); + } + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deletedServiceName) { + return deleteWithResponseAsync(resourceGroupName, deletedServiceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String deletedServiceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, deletedServiceName, context).block(); + } + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 delete(String resourceGroupName, String deletedServiceName) { + deleteWithResponse(resourceGroupName, deletedServiceName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeletedService list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServicesImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServicesImpl.java new file mode 100644 index 000000000000..1a5771ad81f3 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/DeletedServicesImpl.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.apicenter.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.apicenter.fluent.DeletedServicesClient; +import com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner; +import com.azure.resourcemanager.apicenter.models.DeletedService; +import com.azure.resourcemanager.apicenter.models.DeletedServices; +import com.azure.resourcemanager.apicenter.models.DeletedServicesGetByResourceGroupResponse; + +public final class DeletedServicesImpl implements DeletedServices { + private static final ClientLogger LOGGER = new ClientLogger(DeletedServicesImpl.class); + + private final DeletedServicesClient innerClient; + + private final com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager; + + public DeletedServicesImpl(DeletedServicesClient innerClient, + com.azure.resourcemanager.apicenter.ApiCenterManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedServiceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String deletedServiceName, + Context context) { + DeletedServicesGetByResourceGroupResponse inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, deletedServiceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeletedServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeletedService getByResourceGroup(String resourceGroupName, String deletedServiceName) { + DeletedServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, deletedServiceName); + if (inner != null) { + return new DeletedServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String deletedServiceName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, deletedServiceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String deletedServiceName) { + this.serviceClient().delete(resourceGroupName, deletedServiceName); + } + + private DeletedServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.apicenter.ApiCenterManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ServiceImpl.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ServiceImpl.java index 2b2c8193ab5b..e3878fb1fc9c 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ServiceImpl.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/implementation/ServiceImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.apicenter.models.Service; import com.azure.resourcemanager.apicenter.models.ServiceProperties; import com.azure.resourcemanager.apicenter.models.ServiceUpdate; +import com.azure.resourcemanager.apicenter.models.ServiceUpdateProperties; import java.util.Collections; import java.util.Map; @@ -199,6 +200,11 @@ public ServiceImpl withIdentity(ManagedServiceIdentity identity) { } } + public ServiceImpl withProperties(ServiceUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSource.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSource.java new file mode 100644 index 000000000000..dc2f7156c5ba --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSource.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.apicenter.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; + +/** + * An immutable client-side representation of ApiSource. + */ +public interface ApiSource { + /** + * 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: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ApiSourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner object. + * + * @return the inner object. + */ + ApiSourceInner innerModel(); + + /** + * The entirety of the ApiSource definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ApiSource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ApiSource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ApiSource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String serviceName, String workspaceName); + } + + /** + * The stage of the ApiSource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiSource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiSource create(Context context); + } + + /** + * The stage of the ApiSource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ApiSourceProperties properties); + } + } + + /** + * Begins update for the ApiSource resource. + * + * @return the stage of resource update. + */ + ApiSource.Update update(); + + /** + * The template for ApiSource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiSource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiSource apply(Context context); + } + + /** + * The ApiSource update stages. + */ + interface UpdateStages { + /** + * The stage of the ApiSource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ApiSourceProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiSource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiSource refresh(Context context); +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceLinkState.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceLinkState.java new file mode 100644 index 000000000000..e56f71a7168d --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceLinkState.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.apicenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The API source link state. + */ +public final class ApiSourceLinkState extends ExpandableStringEnum { + /** + * Static value initializing for ApiSourceLinkState. + */ + public static final ApiSourceLinkState INITIALIZING = fromString("initializing"); + + /** + * Static value syncing for ApiSourceLinkState. + */ + public static final ApiSourceLinkState SYNCING = fromString("syncing"); + + /** + * Static value error for ApiSourceLinkState. + */ + public static final ApiSourceLinkState ERROR = fromString("error"); + + /** + * Static value deleting for ApiSourceLinkState. + */ + public static final ApiSourceLinkState DELETING = fromString("deleting"); + + /** + * Creates a new instance of ApiSourceLinkState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApiSourceLinkState() { + } + + /** + * Creates or finds a ApiSourceLinkState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApiSourceLinkState. + */ + public static ApiSourceLinkState fromString(String name) { + return fromString(name, ApiSourceLinkState.class); + } + + /** + * Gets known ApiSourceLinkState values. + * + * @return known ApiSourceLinkState values. + */ + public static Collection values() { + return values(ApiSourceLinkState.class); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceListResult.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceListResult.java new file mode 100644 index 000000000000..3a7df1ca1809 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceListResult.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.apicenter.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ApiSource list operation. + */ +@Immutable +public final class ApiSourceListResult implements JsonSerializable { + /* + * The ApiSource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ApiSourceListResult class. + */ + public ApiSourceListResult() { + } + + /** + * Get the value property: The ApiSource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiSourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiSourceListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiSourceListResult. + */ + public static ApiSourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiSourceListResult deserializedApiSourceListResult = new ApiSourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ApiSourceInner.fromJson(reader1)); + deserializedApiSourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApiSourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiSourceListResult; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceProperties.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceProperties.java new file mode 100644 index 000000000000..893e59d282ee --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourceProperties.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * API source properties. + */ +@Fluent +public final class ApiSourceProperties implements JsonSerializable { + /* + * Indicates if the specification should be imported along with metadata. + */ + private ImportSpecificationOptions importSpecification; + + /* + * API source configuration for Azure API Management. + */ + private AzureApiManagementSource azureApiManagementSource; + + /* + * The target environment resource ID. + */ + private String targetEnvironmentId; + + /* + * The target lifecycle stage. + */ + private LifecycleStage targetLifecycleStage; + + /* + * The state of the API source link + */ + private LinkState linkState; + + /** + * Creates an instance of ApiSourceProperties class. + */ + public ApiSourceProperties() { + } + + /** + * Get the importSpecification property: Indicates if the specification should be imported along with metadata. + * + * @return the importSpecification value. + */ + public ImportSpecificationOptions importSpecification() { + return this.importSpecification; + } + + /** + * Set the importSpecification property: Indicates if the specification should be imported along with metadata. + * + * @param importSpecification the importSpecification value to set. + * @return the ApiSourceProperties object itself. + */ + public ApiSourceProperties withImportSpecification(ImportSpecificationOptions importSpecification) { + this.importSpecification = importSpecification; + return this; + } + + /** + * Get the azureApiManagementSource property: API source configuration for Azure API Management. + * + * @return the azureApiManagementSource value. + */ + public AzureApiManagementSource azureApiManagementSource() { + return this.azureApiManagementSource; + } + + /** + * Set the azureApiManagementSource property: API source configuration for Azure API Management. + * + * @param azureApiManagementSource the azureApiManagementSource value to set. + * @return the ApiSourceProperties object itself. + */ + public ApiSourceProperties withAzureApiManagementSource(AzureApiManagementSource azureApiManagementSource) { + this.azureApiManagementSource = azureApiManagementSource; + return this; + } + + /** + * Get the targetEnvironmentId property: The target environment resource ID. + * + * @return the targetEnvironmentId value. + */ + public String targetEnvironmentId() { + return this.targetEnvironmentId; + } + + /** + * Set the targetEnvironmentId property: The target environment resource ID. + * + * @param targetEnvironmentId the targetEnvironmentId value to set. + * @return the ApiSourceProperties object itself. + */ + public ApiSourceProperties withTargetEnvironmentId(String targetEnvironmentId) { + this.targetEnvironmentId = targetEnvironmentId; + return this; + } + + /** + * Get the targetLifecycleStage property: The target lifecycle stage. + * + * @return the targetLifecycleStage value. + */ + public LifecycleStage targetLifecycleStage() { + return this.targetLifecycleStage; + } + + /** + * Set the targetLifecycleStage property: The target lifecycle stage. + * + * @param targetLifecycleStage the targetLifecycleStage value to set. + * @return the ApiSourceProperties object itself. + */ + public ApiSourceProperties withTargetLifecycleStage(LifecycleStage targetLifecycleStage) { + this.targetLifecycleStage = targetLifecycleStage; + return this; + } + + /** + * Get the linkState property: The state of the API source link. + * + * @return the linkState value. + */ + public LinkState linkState() { + return this.linkState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureApiManagementSource() != null) { + azureApiManagementSource().validate(); + } + if (linkState() != null) { + linkState().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("importSpecification", + this.importSpecification == null ? null : this.importSpecification.toString()); + jsonWriter.writeJsonField("azureApiManagementSource", this.azureApiManagementSource); + jsonWriter.writeStringField("targetEnvironmentId", this.targetEnvironmentId); + jsonWriter.writeStringField("targetLifecycleStage", + this.targetLifecycleStage == null ? null : this.targetLifecycleStage.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiSourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiSourceProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiSourceProperties. + */ + public static ApiSourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiSourceProperties deserializedApiSourceProperties = new ApiSourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("importSpecification".equals(fieldName)) { + deserializedApiSourceProperties.importSpecification + = ImportSpecificationOptions.fromString(reader.getString()); + } else if ("azureApiManagementSource".equals(fieldName)) { + deserializedApiSourceProperties.azureApiManagementSource + = AzureApiManagementSource.fromJson(reader); + } else if ("targetEnvironmentId".equals(fieldName)) { + deserializedApiSourceProperties.targetEnvironmentId = reader.getString(); + } else if ("targetLifecycleStage".equals(fieldName)) { + deserializedApiSourceProperties.targetLifecycleStage + = LifecycleStage.fromString(reader.getString()); + } else if ("linkState".equals(fieldName)) { + deserializedApiSourceProperties.linkState = LinkState.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiSourceProperties; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSources.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSources.java new file mode 100644 index 000000000000..c77d3a9affca --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSources.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.apicenter.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 ApiSources. + */ +public interface ApiSources { + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 a ApiSource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String workspaceName); + + /** + * Returns a collection of API sources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param filter OData filter parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiSource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String workspaceName, String filter, + Context context); + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 aPI source entity. + */ + Response getWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context); + + /** + * Returns details of the API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 source entity. + */ + ApiSource get(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName); + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context); + + /** + * Deletes specified API source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspaceName, String apiSourceName); + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name 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 {@link Response}. + */ + Response headWithResponse(String resourceGroupName, String serviceName, String workspaceName, + String apiSourceName, Context context); + + /** + * Checks if specified API source exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName The name of Azure API Center service. + * @param workspaceName The name of the workspace. + * @param apiSourceName The name of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void head(String resourceGroupName, String serviceName, String workspaceName, String apiSourceName); + + /** + * Returns details of the API source. + * + * @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 aPI source entity. + */ + ApiSource getById(String id); + + /** + * Returns details of the API source. + * + * @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 aPI source entity. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes specified API source. + * + * @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 specified API source. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApiSource resource. + * + * @param name resource name. + * @return the first stage of the new ApiSource definition. + */ + ApiSource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesCreateOrUpdateHeaders.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesCreateOrUpdateHeaders.java new file mode 100644 index 000000000000..03ecdf83c96d --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesCreateOrUpdateHeaders.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The ApiSourcesCreateOrUpdateHeaders model. + */ +@Fluent +public final class ApiSourcesCreateOrUpdateHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ApiSourcesCreateOrUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ApiSourcesCreateOrUpdateHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.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 ApiSourcesCreateOrUpdateHeaders object itself. + */ + public ApiSourcesCreateOrUpdateHeaders 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/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesCreateOrUpdateResponse.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesCreateOrUpdateResponse.java new file mode 100644 index 000000000000..9e15580a1122 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesCreateOrUpdateResponse.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.apicenter.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; + +/** + * Contains all response data for the createOrUpdate operation. + */ +public final class ApiSourcesCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApiSourcesCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApiSourcesCreateOrUpdateResponse. + * @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 ApiSourcesCreateOrUpdateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ApiSourceInner value, ApiSourcesCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ApiSourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesGetHeaders.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesGetHeaders.java new file mode 100644 index 000000000000..af85e24bd85d --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesGetHeaders.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The ApiSourcesGetHeaders model. + */ +@Fluent +public final class ApiSourcesGetHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ApiSourcesGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ApiSourcesGetHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.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 ApiSourcesGetHeaders object itself. + */ + public ApiSourcesGetHeaders 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/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesGetResponse.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesGetResponse.java new file mode 100644 index 000000000000..191f86efe691 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ApiSourcesGetResponse.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.apicenter.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apicenter.fluent.models.ApiSourceInner; + +/** + * Contains all response data for the get operation. + */ +public final class ApiSourcesGetResponse extends ResponseBase { + /** + * Creates an instance of ApiSourcesGetResponse. + * + * @param request the request which resulted in this ApiSourcesGetResponse. + * @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 ApiSourcesGetResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, ApiSourceInner value, + ApiSourcesGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ApiSourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/AzureApiManagementSource.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/AzureApiManagementSource.java new file mode 100644 index 000000000000..7453b9714116 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/AzureApiManagementSource.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * API source configuration for Azure API Management. + */ +@Fluent +public final class AzureApiManagementSource implements JsonSerializable { + /* + * API Management service resource ID. + */ + private String resourceId; + + /* + * The resource ID of the managed identity that has access to the API Management instance. + */ + private String msiResourceId; + + /** + * Creates an instance of AzureApiManagementSource class. + */ + public AzureApiManagementSource() { + } + + /** + * Get the resourceId property: API Management service resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: API Management service resource ID. + * + * @param resourceId the resourceId value to set. + * @return the AzureApiManagementSource object itself. + */ + public AzureApiManagementSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the msiResourceId property: The resource ID of the managed identity that has access to the API Management + * instance. + * + * @return the msiResourceId value. + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set the msiResourceId property: The resource ID of the managed identity that has access to the API Management + * instance. + * + * @param msiResourceId the msiResourceId value to set. + * @return the AzureApiManagementSource object itself. + */ + public AzureApiManagementSource withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceId in model AzureApiManagementSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureApiManagementSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("msiResourceId", this.msiResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureApiManagementSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureApiManagementSource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureApiManagementSource. + */ + public static AzureApiManagementSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureApiManagementSource deserializedAzureApiManagementSource = new AzureApiManagementSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedAzureApiManagementSource.resourceId = reader.getString(); + } else if ("msiResourceId".equals(fieldName)) { + deserializedAzureApiManagementSource.msiResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureApiManagementSource; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedService.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedService.java new file mode 100644 index 000000000000..dea0dc42a38e --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedService.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.apicenter.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner; + +/** + * An immutable client-side representation of DeletedService. + */ +public interface DeletedService { + /** + * 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: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DeletedServiceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner object. + * + * @return the inner object. + */ + DeletedServiceInner innerModel(); +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServiceListResult.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServiceListResult.java new file mode 100644 index 000000000000..563e3160238c --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServiceListResult.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.apicenter.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DeletedService list operation. + */ +@Immutable +public final class DeletedServiceListResult implements JsonSerializable { + /* + * The DeletedService items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DeletedServiceListResult class. + */ + public DeletedServiceListResult() { + } + + /** + * Get the value property: The DeletedService items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedServiceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedServiceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeletedServiceListResult. + */ + public static DeletedServiceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedServiceListResult deserializedDeletedServiceListResult = new DeletedServiceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DeletedServiceInner.fromJson(reader1)); + deserializedDeletedServiceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeletedServiceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedServiceListResult; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServiceProperties.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServiceProperties.java new file mode 100644 index 000000000000..7a343d3c53a8 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServiceProperties.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Deleted service properties. + */ +@Fluent +public final class DeletedServiceProperties implements JsonSerializable { + /* + * 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. + */ + private OffsetDateTime scheduledPurgeDate; + + /* + * UTC date and time 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. + */ + private OffsetDateTime softDeletionDate; + + /** + * Creates an instance of DeletedServiceProperties class. + */ + public DeletedServiceProperties() { + } + + /** + * 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 DeletedServiceProperties object itself. + */ + public DeletedServiceProperties withScheduledPurgeDate(OffsetDateTime scheduledPurgeDate) { + this.scheduledPurgeDate = scheduledPurgeDate; + return this; + } + + /** + * Get the softDeletionDate property: UTC date and time 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 softDeletionDate value. + */ + public OffsetDateTime softDeletionDate() { + return this.softDeletionDate; + } + + /** + * Set the softDeletionDate property: UTC date and time 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 softDeletionDate the softDeletionDate value to set. + * @return the DeletedServiceProperties object itself. + */ + public DeletedServiceProperties withSoftDeletionDate(OffsetDateTime softDeletionDate) { + this.softDeletionDate = softDeletionDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduledPurgeDate", + this.scheduledPurgeDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduledPurgeDate)); + jsonWriter.writeStringField("softDeletionDate", + this.softDeletionDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.softDeletionDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedServiceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedServiceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeletedServiceProperties. + */ + public static DeletedServiceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedServiceProperties deserializedDeletedServiceProperties = new DeletedServiceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduledPurgeDate".equals(fieldName)) { + deserializedDeletedServiceProperties.scheduledPurgeDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("softDeletionDate".equals(fieldName)) { + deserializedDeletedServiceProperties.softDeletionDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedServiceProperties; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServices.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServices.java new file mode 100644 index 000000000000..930ba2556047 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServices.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.apicenter.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 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists soft-deleted services. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeletedService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String deletedServiceName, + Context context); + + /** + * Returns details of the soft-deleted service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 service entity. + */ + DeletedService getByResourceGroup(String resourceGroupName, String deletedServiceName); + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String deletedServiceName, + Context context); + + /** + * Permanently deletes specified service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deletedServiceName The name of the deleted 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 deleteByResourceGroup(String resourceGroupName, String deletedServiceName); +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServicesGetByResourceGroupHeaders.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServicesGetByResourceGroupHeaders.java new file mode 100644 index 000000000000..985617028ec6 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServicesGetByResourceGroupHeaders.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The DeletedServicesGetByResourceGroupHeaders model. + */ +@Fluent +public final class DeletedServicesGetByResourceGroupHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of DeletedServicesGetByResourceGroupHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public DeletedServicesGetByResourceGroupHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.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 DeletedServicesGetByResourceGroupHeaders object itself. + */ + public DeletedServicesGetByResourceGroupHeaders 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/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServicesGetByResourceGroupResponse.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServicesGetByResourceGroupResponse.java new file mode 100644 index 000000000000..f8e9515c1510 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/DeletedServicesGetByResourceGroupResponse.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.apicenter.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.apicenter.fluent.models.DeletedServiceInner; + +/** + * Contains all response data for the getByResourceGroup operation. + */ +public final class DeletedServicesGetByResourceGroupResponse + extends ResponseBase { + /** + * Creates an instance of DeletedServicesGetByResourceGroupResponse. + * + * @param request the request which resulted in this DeletedServicesGetByResourceGroupResponse. + * @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 DeletedServicesGetByResourceGroupResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + DeletedServiceInner value, DeletedServicesGetByResourceGroupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public DeletedServiceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ImportSpecificationOptions.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ImportSpecificationOptions.java new file mode 100644 index 000000000000..bf6f8c6d9f82 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ImportSpecificationOptions.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.apicenter.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates if the specification should be imported along with metadata. + */ +public final class ImportSpecificationOptions extends ExpandableStringEnum { + /** + * Static value never for ImportSpecificationOptions. + */ + public static final ImportSpecificationOptions NEVER = fromString("never"); + + /** + * Static value ondemand for ImportSpecificationOptions. + */ + public static final ImportSpecificationOptions ONDEMAND = fromString("ondemand"); + + /** + * Static value always for ImportSpecificationOptions. + */ + public static final ImportSpecificationOptions ALWAYS = fromString("always"); + + /** + * Creates a new instance of ImportSpecificationOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImportSpecificationOptions() { + } + + /** + * Creates or finds a ImportSpecificationOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImportSpecificationOptions. + */ + public static ImportSpecificationOptions fromString(String name) { + return fromString(name, ImportSpecificationOptions.class); + } + + /** + * Gets known ImportSpecificationOptions values. + * + * @return known ImportSpecificationOptions values. + */ + public static Collection values() { + return values(ImportSpecificationOptions.class); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/LinkState.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/LinkState.java new file mode 100644 index 000000000000..2093db897df8 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/LinkState.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The link state. + */ +@Fluent +public final class LinkState implements JsonSerializable { + /* + * The state of the link. + */ + private ApiSourceLinkState state; + + /* + * The state message. + */ + private String message; + + /* + * The timestamp of the last update of the link state. + */ + private OffsetDateTime lastUpdatedOn; + + /** + * Creates an instance of LinkState class. + */ + public LinkState() { + } + + /** + * Get the state property: The state of the link. + * + * @return the state value. + */ + public ApiSourceLinkState state() { + return this.state; + } + + /** + * Set the state property: The state of the link. + * + * @param state the state value to set. + * @return the LinkState object itself. + */ + public LinkState withState(ApiSourceLinkState state) { + this.state = state; + return this; + } + + /** + * Get the message property: The state message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The state message. + * + * @param message the message value to set. + * @return the LinkState object itself. + */ + public LinkState withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the lastUpdatedOn property: The timestamp of the last update of the link state. + * + * @return the lastUpdatedOn value. + */ + public OffsetDateTime lastUpdatedOn() { + return this.lastUpdatedOn; + } + + /** + * Set the lastUpdatedOn property: The timestamp of the last update of the link state. + * + * @param lastUpdatedOn the lastUpdatedOn value to set. + * @return the LinkState object itself. + */ + public LinkState withLastUpdatedOn(OffsetDateTime lastUpdatedOn) { + this.lastUpdatedOn = lastUpdatedOn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lastUpdatedOn() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property lastUpdatedOn in model LinkState")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LinkState.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastUpdatedOn", + this.lastUpdatedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedOn)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkState if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LinkState. + */ + public static LinkState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkState deserializedLinkState = new LinkState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastUpdatedOn".equals(fieldName)) { + deserializedLinkState.lastUpdatedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedLinkState.state = ApiSourceLinkState.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedLinkState.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinkState; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/Service.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/Service.java index 261849627913..acc4e0298540 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/Service.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/Service.java @@ -221,7 +221,7 @@ interface WithIdentity { /** * The template for Service update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { /** * Executes the update request. * @@ -267,6 +267,19 @@ interface WithIdentity { */ Update withIdentity(ManagedServiceIdentity identity); } + + /** + * The stage of the Service update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ServiceUpdateProperties properties); + } } /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceProperties.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceProperties.java index 77ae59520d6f..e5a21db544c8 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceProperties.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.apicenter.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,13 +14,19 @@ /** * The properties of the service. */ -@Immutable +@Fluent public final class ServiceProperties implements JsonSerializable { /* * Provisioning state of the service. */ private ProvisioningState provisioningState; + /* + * Flag used to restore soft-deleted API Center service. If specified and set to 'true' all other properties will be + * ignored. + */ + private Boolean restore; + /** * Creates an instance of ServiceProperties class. */ @@ -36,6 +42,28 @@ public ProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the restore property: Flag used to restore soft-deleted API Center service. If 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: Flag used to restore soft-deleted API Center service. If specified and set to 'true' + * all other properties will be ignored. + * + * @param restore the restore value to set. + * @return the ServiceProperties object itself. + */ + public ServiceProperties withRestore(Boolean restore) { + this.restore = restore; + return this; + } + /** * Validates the instance. * @@ -50,6 +78,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("restore", this.restore); return jsonWriter.writeEndObject(); } @@ -70,6 +99,8 @@ public static ServiceProperties fromJson(JsonReader jsonReader) throws IOExcepti if ("provisioningState".equals(fieldName)) { deserializedServiceProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("restore".equals(fieldName)) { + deserializedServiceProperties.restore = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdate.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdate.java index 80f01865f5a6..c753ff2a04a0 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdate.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdate.java @@ -27,6 +27,11 @@ public final class ServiceUpdate implements JsonSerializable { */ private Map tags; + /* + * The resource-specific properties for this resource. + */ + private ServiceUpdateProperties properties; + /** * Creates an instance of ServiceUpdate class. */ @@ -73,6 +78,26 @@ public ServiceUpdate withTags(Map tags) { return this; } + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ServiceUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ServiceUpdate object itself. + */ + public ServiceUpdate withProperties(ServiceUpdateProperties properties) { + this.properties = properties; + return this; + } + /** * Validates the instance. * @@ -82,6 +107,9 @@ public void validate() { if (identity() != null) { identity().validate(); } + if (properties() != null) { + properties().validate(); + } } /** @@ -92,6 +120,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -115,6 +144,8 @@ public static ServiceUpdate fromJson(JsonReader jsonReader) throws IOException { } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedServiceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedServiceUpdate.properties = ServiceUpdateProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdateProperties.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdateProperties.java new file mode 100644 index 000000000000..df9be80043d3 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/java/com/azure/resourcemanager/apicenter/models/ServiceUpdateProperties.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.apicenter.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the Service. + */ +@Fluent +public final class ServiceUpdateProperties implements JsonSerializable { + /* + * Flag used to restore soft-deleted API Center service. If specified and set to 'true' all other properties will be + * ignored. + */ + private Boolean restore; + + /** + * Creates an instance of ServiceUpdateProperties class. + */ + public ServiceUpdateProperties() { + } + + /** + * Get the restore property: Flag used to restore soft-deleted API Center service. If 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: Flag used to restore soft-deleted API Center service. If specified and set to 'true' + * all other properties will be ignored. + * + * @param restore the restore value to set. + * @return the ServiceUpdateProperties object itself. + */ + public ServiceUpdateProperties withRestore(Boolean restore) { + this.restore = restore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("restore", this.restore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceUpdateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceUpdateProperties. + */ + public static ServiceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceUpdateProperties deserializedServiceUpdateProperties = new ServiceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("restore".equals(fieldName)) { + deserializedServiceUpdateProperties.restore = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceUpdateProperties; + }); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-apicenter/proxy-config.json b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-apicenter/proxy-config.json index 978602c85aa6..f38408ddd70a 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-apicenter/proxy-config.json +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-apicenter/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.apicenter.implementation.ApiDefinitionsClientImpl$ApiDefinitionsService"],["com.azure.resourcemanager.apicenter.implementation.ApiVersionsClientImpl$ApiVersionsService"],["com.azure.resourcemanager.apicenter.implementation.ApisClientImpl$ApisService"],["com.azure.resourcemanager.apicenter.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.apicenter.implementation.EnvironmentsClientImpl$EnvironmentsService"],["com.azure.resourcemanager.apicenter.implementation.MetadataSchemasClientImpl$MetadataSchemasService"],["com.azure.resourcemanager.apicenter.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.apicenter.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.apicenter.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file +[["com.azure.resourcemanager.apicenter.implementation.ApiDefinitionsClientImpl$ApiDefinitionsService"],["com.azure.resourcemanager.apicenter.implementation.ApiSourcesClientImpl$ApiSourcesService"],["com.azure.resourcemanager.apicenter.implementation.ApiVersionsClientImpl$ApiVersionsService"],["com.azure.resourcemanager.apicenter.implementation.ApisClientImpl$ApisService"],["com.azure.resourcemanager.apicenter.implementation.DeletedServicesClientImpl$DeletedServicesService"],["com.azure.resourcemanager.apicenter.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.apicenter.implementation.EnvironmentsClientImpl$EnvironmentsService"],["com.azure.resourcemanager.apicenter.implementation.MetadataSchemasClientImpl$MetadataSchemasService"],["com.azure.resourcemanager.apicenter.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.apicenter.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.apicenter.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/azure-resourcemanager-apicenter.properties b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/azure-resourcemanager-apicenter.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/main/resources/azure-resourcemanager-apicenter.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateSamples.java index 0632b5c7301e..731ea7095987 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateSamples.java @@ -9,7 +9,8 @@ */ public final class ApiDefinitionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiDefinitions_CreateOrUpdate.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteSamples.java index 8358e2dd7722..ba81b0d78792 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteSamples.java @@ -10,8 +10,8 @@ public final class ApiDefinitionsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Delete. - * json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_Delete.json */ /** * Sample code: ApiDefinitions_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationSamples.java index f2ebabadb03b..2bd0bc8f3bbe 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationSamples.java @@ -9,7 +9,8 @@ */ public final class ApiDefinitionsExportSpecificationSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiDefinitions_ExportSpecification.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetSamples.java index 1440c29bd46c..665bfe92fa72 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetSamples.java @@ -10,7 +10,8 @@ public final class ApiDefinitionsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_Get.json */ /** * Sample code: ApiDefinitions_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadSamples.java index 1433a2c5ec23..6402a82a26f1 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadSamples.java @@ -10,7 +10,8 @@ public final class ApiDefinitionsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_Head.json */ /** * Sample code: ApiDefinitions_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationSamples.java index 65286881a841..05da20063bd1 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationSamples.java @@ -9,7 +9,8 @@ */ public final class ApiDefinitionsImportSpecificationSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiDefinitions_ImportSpecification.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListSamples.java index 9f39bcc6ff79..7ee07ac2d771 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListSamples.java @@ -10,7 +10,8 @@ public final class ApiDefinitionsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiDefinitions_List.json */ /** * Sample code: ApiDefinitions_ListByApiVersion. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..01f897cecc2e --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesCreateOrUpdateSamples.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.apicenter.generated; + +import com.azure.resourcemanager.apicenter.models.ApiSourceProperties; +import com.azure.resourcemanager.apicenter.models.AzureApiManagementSource; +import com.azure.resourcemanager.apicenter.models.ImportSpecificationOptions; +import com.azure.resourcemanager.apicenter.models.LifecycleStage; + +/** + * Samples for ApiSources CreateOrUpdate. + */ +public final class ApiSourcesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiSources_CreateOrUpdate.json + */ + /** + * Sample code: ApiSources_CreateOrUpdate. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesCreateOrUpdate(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .define("contoso-api-management") + .withExistingWorkspace("contoso-resources", "contoso", "default") + .withProperties(new ApiSourceProperties().withImportSpecification(ImportSpecificationOptions.ONDEMAND) + .withAzureApiManagementSource(new AzureApiManagementSource().withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso") + .withMsiResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity")) + .withTargetEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/azure-api-management") + .withTargetLifecycleStage(LifecycleStage.DESIGN)) + .create(); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesDeleteSamples.java new file mode 100644 index 000000000000..449b78a82881 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesDeleteSamples.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.apicenter.generated; + +/** + * Samples for ApiSources Delete. + */ +public final class ApiSourcesDeleteSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiSources_Delete.json + */ + /** + * Sample code: ApiSources_Delete. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesDelete(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .deleteWithResponse("contoso-resources", "contoso", "default", "contoso-api-management", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesGetSamples.java new file mode 100644 index 000000000000..9951cd75893d --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesGetSamples.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.apicenter.generated; + +/** + * Samples for ApiSources Get. + */ +public final class ApiSourcesGetSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiSources_Get. + * json + */ + /** + * Sample code: ApiSources_Get. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesGet(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .getWithResponse("contoso-resources", "contoso", "default", "contoso-api-management", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesHeadSamples.java new file mode 100644 index 000000000000..9d8dfbf4f267 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesHeadSamples.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.apicenter.generated; + +/** + * Samples for ApiSources Head. + */ +public final class ApiSourcesHeadSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiSources_Head. + * json + */ + /** + * Sample code: ApiSources_Head. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesHead(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources() + .headWithResponse("contoso-resources", "contoso", "default", "contoso-api-management", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesListSamples.java new file mode 100644 index 000000000000..5548cb7078ef --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiSourcesListSamples.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.apicenter.generated; + +/** + * Samples for ApiSources List. + */ +public final class ApiSourcesListSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiSources_List. + * json + */ + /** + * Sample code: ApiSources_ListByWorkspace. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void apiSourcesListByWorkspace(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.apiSources().list("contoso-resources", "contoso", "default", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateSamples.java index 600de72d9860..e5e71dd01669 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateSamples.java @@ -9,7 +9,8 @@ */ public final class ApiVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * ApiVersions_CreateOrUpdate.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteSamples.java index 1925dc3820ee..ff49e1565eef 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteSamples.java @@ -10,7 +10,8 @@ public final class ApiVersionsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * ApiVersions_Delete.json */ /** * Sample code: ApiVersions_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetSamples.java index b9cc4bbcbdb0..0f40fe4fe7c3 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetSamples.java @@ -10,7 +10,8 @@ public final class ApiVersionsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiVersions_Get. + * json */ /** * Sample code: ApiVersions_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadSamples.java index cd1b7ece41b8..06235dcbe4bb 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadSamples.java @@ -10,7 +10,8 @@ public final class ApiVersionsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiVersions_Head + * .json */ /** * Sample code: ApiVersions_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListSamples.java index 597d85eca399..6e1c5ec0918e 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListSamples.java @@ -10,7 +10,8 @@ public final class ApiVersionsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ApiVersions_List + * .json */ /** * Sample code: ApiVersions_ListByApi. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateSamples.java index fbf5fb6cad4c..e489dd7cb1b5 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateSamples.java @@ -10,7 +10,8 @@ public final class ApisCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_CreateOrUpdate.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Apis_CreateOrUpdate.json */ /** * Sample code: Apis_CreateOrUpdate. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteSamples.java index 4d6ce4f43d3e..56b3d3a6da4d 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteSamples.java @@ -10,7 +10,7 @@ public final class ApisDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_Delete.json */ /** * Sample code: Apis_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisGetSamples.java index 6d684ef26080..f1f4c96d4bd8 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisGetSamples.java @@ -10,7 +10,7 @@ public final class ApisGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_Get.json */ /** * Sample code: Apis_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisHeadSamples.java index 090ba2abac85..bd44d5ef7120 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisHeadSamples.java @@ -10,7 +10,7 @@ public final class ApisHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_Head.json */ /** * Sample code: Apis_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisListSamples.java index 2ab53372c985..b3f27d3003bd 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ApisListSamples.java @@ -10,7 +10,7 @@ public final class ApisListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Apis_List.json */ /** * Sample code: Apis_ListByWorkspace. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesDeleteSamples.java new file mode 100644 index 000000000000..c327fa6ac371 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesDeleteSamples.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.apicenter.generated; + +/** + * Samples for DeletedServices Delete. + */ +public final class DeletedServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_Delete.json + */ + /** + * Sample code: DeletedServices_Delete. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesDelete(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices() + .deleteByResourceGroupWithResponse("contoso-resources", "contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesGetByResourceGroupSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4113df8c4729 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesGetByResourceGroupSamples.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.apicenter.generated; + +/** + * Samples for DeletedServices GetByResourceGroup. + */ +public final class DeletedServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_Get.json + */ + /** + * Sample code: DeletedServices_Get. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesGet(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices() + .getByResourceGroupWithResponse("contoso-resources", "contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesListByResourceGroupSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..f937ee22cfad --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesListByResourceGroupSamples.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.apicenter.generated; + +/** + * Samples for DeletedServices ListByResourceGroup. + */ +public final class DeletedServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_ListBySubscription.json + */ + /** + * Sample code: DeletedServices_List. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesList(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices().listByResourceGroup("contoso-resources", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesListSamples.java new file mode 100644 index 000000000000..59149297d1f0 --- /dev/null +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeletedServicesListSamples.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.apicenter.generated; + +/** + * Samples for DeletedServices List. + */ +public final class DeletedServicesListSamples { + /* + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * DeletedServices_List.json + */ + /** + * Sample code: DeletedServices_ListBySubscription. + * + * @param manager Entry point to ApiCenterManager. + */ + public static void deletedServicesListBySubscription(com.azure.resourcemanager.apicenter.ApiCenterManager manager) { + manager.deletedServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateSamples.java index c6d3b4de2f92..82a5528ca117 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateSamples.java @@ -9,7 +9,8 @@ */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Deployments_CreateOrUpdate.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteSamples.java index 461ad5532083..a871a577f3f8 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteSamples.java @@ -10,7 +10,8 @@ public final class DeploymentsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Deployments_Delete.json */ /** * Sample code: Deployments_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetSamples.java index c9ed27d21e93..dafc689c35d9 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetSamples.java @@ -10,7 +10,8 @@ public final class DeploymentsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Deployments_Get. + * json */ /** * Sample code: Deployments_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadSamples.java index 3452c1a16392..d407f6f3c8b1 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadSamples.java @@ -10,7 +10,8 @@ public final class DeploymentsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Deployments_Head + * .json */ /** * Sample code: Deployments_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListSamples.java index 28c685c49796..4380b79c8be0 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListSamples.java @@ -10,7 +10,8 @@ public final class DeploymentsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Deployments_List + * .json */ /** * Sample code: Deployments_ListByApi. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateSamples.java index 4bd5a323e8e8..9587354bc84f 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateSamples.java @@ -9,7 +9,8 @@ */ public final class EnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Environments_CreateOrUpdate.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteSamples.java index c3fa9d34177f..a1030ec6c245 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteSamples.java @@ -10,7 +10,8 @@ public final class EnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Environments_Delete.json */ /** * Sample code: Environments_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetSamples.java index a6368b7fe49f..6f54ddad7bb5 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetSamples.java @@ -10,7 +10,8 @@ public final class EnvironmentsGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Environments_Get + * .json */ /** * Sample code: Environments_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadSamples.java index 920ce9dae8d8..00711715e242 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadSamples.java @@ -10,7 +10,8 @@ public final class EnvironmentsHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Environments_Head.json */ /** * Sample code: Environments_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListSamples.java index f22f16ae00ff..d62d6eb41d32 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListSamples.java @@ -10,7 +10,8 @@ public final class EnvironmentsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Environments_List.json */ /** * Sample code: Environments_ListByWorkspace. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateSamples.java index d6c35356fb6b..325aaf9d180f 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateSamples.java @@ -9,7 +9,8 @@ */ public final class MetadataSchemasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * MetadataSchemas_CreateOrUpdate.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteSamples.java index 8628d18e1c82..6c1d7a263b0d 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteSamples.java @@ -10,8 +10,8 @@ public final class MetadataSchemasDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Delete. - * json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_Delete.json */ /** * Sample code: MetadataSchemas_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetSamples.java index 359bde965718..265b3ac0aa9b 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetSamples.java @@ -10,7 +10,8 @@ public final class MetadataSchemasGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_Get.json */ /** * Sample code: MetadataSchemas_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadSamples.java index 418658af2361..93a2bffed563 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadSamples.java @@ -10,7 +10,8 @@ public final class MetadataSchemasHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_Head.json */ /** * Sample code: MetadataSchemas_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListSamples.java index 16e229dd93fd..3d23f31de6e8 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListSamples.java @@ -10,7 +10,8 @@ public final class MetadataSchemasListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * MetadataSchemas_List.json */ /** * Sample code: MetadataSchemas_ListByService. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/OperationsListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/OperationsListSamples.java index e33c057e701c..e17116b297a5 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/OperationsListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/OperationsListSamples.java @@ -10,7 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Operations_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Operations_List. + * json */ /** * Sample code: List Provider Operations. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateSamples.java index 84e9854ae677..ea173dd4a519 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateSamples.java @@ -17,8 +17,8 @@ public final class ServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_CreateOrUpdate. - * json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Services_CreateOrUpdate.json */ /** * Sample code: Services_CreateOrUpdate. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteSamples.java index 54bc2108b2b9..2f900c7a9010 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteSamples.java @@ -10,7 +10,8 @@ public final class ServicesDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Services_Delete. + * json */ /** * Sample code: Services_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaSamples.java index 88952118a994..30bfcfdbc2c8 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaSamples.java @@ -9,7 +9,8 @@ */ public final class ServicesExportMetadataSchemaSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Services_ExportMetadataSchema.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupSamples.java index 449df8f120f9..58f984163315 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupSamples.java @@ -10,7 +10,8 @@ public final class ServicesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Services_Get. + * json */ /** * Sample code: Services_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupSamples.java index 8f7db0d7d144..7e943334cb71 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class ServicesListByResourceGroupSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Services_ListByResourceGroup.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListSamples.java index 65c377a277d1..fadecf1c43fe 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesListSamples.java @@ -9,7 +9,8 @@ */ public final class ServicesListSamples { /* - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ + * x-ms-original-file: + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ * Services_ListBySubscription.json */ /** diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesUpdateSamples.java index 2a7c11d15ce9..7b305514c18e 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/ServicesUpdateSamples.java @@ -12,7 +12,8 @@ public final class ServicesUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Update.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Services_Update. + * json */ /** * Sample code: Services_Update. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateSamples.java index ac28e7081f0a..123017f83b50 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_CreateOrUpdate - * .json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Workspaces_CreateOrUpdate.json */ /** * Sample code: Workspaces_CreateOrUpdate. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteSamples.java index c35db73f7ce1..d22cac34d288 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteSamples.java @@ -10,7 +10,8 @@ public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Delete.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/ + * Workspaces_Delete.json */ /** * Sample code: Workspaces_Delete. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetSamples.java index a1907a7a5565..cb823c81e254 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetSamples.java @@ -10,7 +10,8 @@ public final class WorkspacesGetSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Get.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Workspaces_Get. + * json */ /** * Sample code: Workspaces_Get. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadSamples.java index e63ec64a5b76..dc0d55a806d5 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadSamples.java @@ -10,7 +10,8 @@ public final class WorkspacesHeadSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Head.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Workspaces_Head. + * json */ /** * Sample code: Workspaces_Head. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListSamples.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListSamples.java index 1226f3c37874..9a6e86056e35 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListSamples.java +++ b/sdk/apicenter/azure-resourcemanager-apicenter/src/samples/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListSamples.java @@ -10,7 +10,8 @@ public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_List.json + * specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/examples/Workspaces_List. + * json */ /** * Sample code: Workspaces_ListByService. diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionInnerTests.java deleted file mode 100644 index 50d3935cdef7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.ApiDefinitionInner; -import com.azure.resourcemanager.apicenter.models.ApiDefinitionProperties; -import org.junit.jupiter.api.Assertions; - -public final class ApiDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiDefinitionInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"qnermclfplphoxu\",\"description\":\"rpabg\",\"specification\":{\"name\":\"sbj\",\"version\":\"zq\"}},\"id\":\"xywpmueefjzwfqkq\",\"name\":\"jidsuyonobglaoc\",\"type\":\"xtccmg\"}") - .toObject(ApiDefinitionInner.class); - Assertions.assertEquals("qnermclfplphoxu", model.properties().title()); - Assertions.assertEquals("rpabg", model.properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiDefinitionInner model = new ApiDefinitionInner() - .withProperties(new ApiDefinitionProperties().withTitle("qnermclfplphoxu").withDescription("rpabg")); - model = BinaryData.fromObject(model).toObject(ApiDefinitionInner.class); - Assertions.assertEquals("qnermclfplphoxu", model.properties().title()); - Assertions.assertEquals("rpabg", model.properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionListResultTests.java deleted file mode 100644 index 1ff8bc5ee179..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiDefinitionListResult; - -public final class ApiDefinitionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"sthsu\",\"description\":\"cmnyyazttb\",\"specification\":{\"name\":\"rq\",\"version\":\"edckzywbiexzfey\"}},\"id\":\"axibxujw\",\"name\":\"hqwa\",\"type\":\"muzyoxaepdk\"},{\"properties\":{\"title\":\"ancuxrhd\",\"description\":\"avxbniwdjswztsdb\",\"specification\":{\"name\":\"xytxhpzxbz\",\"version\":\"zabglcuhxwt\"}},\"id\":\"yqiklbbovplwzb\",\"name\":\"vgyuguos\",\"type\":\"mkfssxqukkfplgm\"},{\"properties\":{\"title\":\"xnkjzkdesl\",\"description\":\"lopwiyig\",\"specification\":{\"name\":\"kdwzbaiuebbaumny\",\"version\":\"ped\"}},\"id\":\"jn\",\"name\":\"bckhsmtxpsi\",\"type\":\"btfhvpesaps\"},{\"properties\":{\"title\":\"dqmh\",\"description\":\"dhtldwkyz\",\"specification\":{\"name\":\"tkncwsc\",\"version\":\"vlxotogtwrupqsx\"}},\"id\":\"micykvceoveilo\",\"name\":\"notyfjfcnjbkcn\",\"type\":\"dhbt\"}],\"nextLink\":\"phywpnvj\"}") - .toObject(ApiDefinitionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiDefinitionListResult model = new ApiDefinitionListResult(); - model = BinaryData.fromObject(model).toObject(ApiDefinitionListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionPropertiesSpecificationTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionPropertiesSpecificationTests.java deleted file mode 100644 index 0e11f871900f..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionPropertiesSpecificationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiDefinitionPropertiesSpecification; -import org.junit.jupiter.api.Assertions; - -public final class ApiDefinitionPropertiesSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiDefinitionPropertiesSpecification model - = BinaryData.fromString("{\"name\":\"ycanuzbpzkafku\",\"version\":\"crnwbmeh\"}") - .toObject(ApiDefinitionPropertiesSpecification.class); - Assertions.assertEquals("ycanuzbpzkafku", model.name()); - Assertions.assertEquals("crnwbmeh", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiDefinitionPropertiesSpecification model - = new ApiDefinitionPropertiesSpecification().withName("ycanuzbpzkafku").withVersion("crnwbmeh"); - model = BinaryData.fromObject(model).toObject(ApiDefinitionPropertiesSpecification.class); - Assertions.assertEquals("ycanuzbpzkafku", model.name()); - Assertions.assertEquals("crnwbmeh", model.version()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionPropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionPropertiesTests.java deleted file mode 100644 index fec468e5750c..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiDefinitionProperties; -import org.junit.jupiter.api.Assertions; - -public final class ApiDefinitionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiDefinitionProperties model = BinaryData.fromString( - "{\"title\":\"udxytlmoyrx\",\"description\":\"fudwpznt\",\"specification\":{\"name\":\"zhlrqjb\",\"version\":\"kfrlhrxsbky\"}}") - .toObject(ApiDefinitionProperties.class); - Assertions.assertEquals("udxytlmoyrx", model.title()); - Assertions.assertEquals("fudwpznt", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiDefinitionProperties model - = new ApiDefinitionProperties().withTitle("udxytlmoyrx").withDescription("fudwpznt"); - model = BinaryData.fromObject(model).toObject(ApiDefinitionProperties.class); - Assertions.assertEquals("udxytlmoyrx", model.title()); - Assertions.assertEquals("fudwpznt", model.description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 80c18e0f629e..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiDefinition; -import com.azure.resourcemanager.apicenter.models.ApiDefinitionProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"iyujviylwdshfs\",\"description\":\"rbgyefry\",\"specification\":{\"name\":\"aojfm\",\"version\":\"cotmr\"}},\"id\":\"irctymoxoftpipiw\",\"name\":\"czuhxacpqjlihh\",\"type\":\"usps\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiDefinition response = manager.apiDefinitions() - .define("ejnt") - .withExistingVersion("z", "ybycnunvj", "rtkfawnopq", "ikyzirtxdy", "x") - .withProperties( - new ApiDefinitionProperties().withTitle("ewgioilqukrydxt").withDescription("ieoxorggufhyaomt")) - .create(); - - Assertions.assertEquals("iyujviylwdshfs", response.properties().title()); - Assertions.assertEquals("rbgyefry", response.properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteWithResponseMockTests.java deleted file mode 100644 index 4ba562ae1e07..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apiDefinitions() - .deleteWithResponse("lrcoolsttpki", "kkbnu", "rywvtylbfpn", "urdoi", "iithtywu", "xcbihw", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationMockTests.java deleted file mode 100644 index b989d84188da..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsExportSpecificationMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiSpecExportResult; -import com.azure.resourcemanager.apicenter.models.ApiSpecExportResultFormat; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsExportSpecificationMockTests { - @Test - public void testExportSpecification() throws Exception { - String responseStr = "{\"format\":\"link\",\"value\":\"asxifto\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiSpecExportResult response = manager.apiDefinitions() - .exportSpecification("gseinq", "iufxqknpir", "nepttwqmsni", "fcdmqnrojlpijn", "rxfrddhc", "atiz", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ApiSpecExportResultFormat.LINK, response.format()); - Assertions.assertEquals("asxifto", response.value()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetWithResponseMockTests.java deleted file mode 100644 index 10d9487dd5d2..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"lwfffi\",\"description\":\"pjpqqmtedltmmji\",\"specification\":{\"name\":\"ozphvwauyqncygu\",\"version\":\"vipmdscwxqupevzh\"}},\"id\":\"totxhojujb\",\"name\":\"pelmcuvhixbjxyf\",\"type\":\"n\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiDefinition response = manager.apiDefinitions() - .getWithResponse("sxtta", "gzxnfaazpxdtnk", "mkqjj", "wuenvr", "pyouaibrebqaays", "kixqtnqtt", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lwfffi", response.properties().title()); - Assertions.assertEquals("pjpqqmtedltmmji", response.properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadWithResponseMockTests.java deleted file mode 100644 index 33bc6c11dc8c..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsHeadWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apiDefinitions() - .headWithResponse("knfd", "twjchrdg", "ihxumwctondzj", "uu", "fdlwg", "ytsbwtovv", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationMockTests.java deleted file mode 100644 index 253ba6dce2f7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsImportSpecificationMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequest; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequestSpecification; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportSourceFormat; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsImportSpecificationMockTests { - @Test - public void testImportSpecification() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apiDefinitions() - .importSpecification("qyzhf", "wesgogczh", "nnxk", "lgnyhmo", "sxkkg", "h", - new ApiSpecImportRequest().withValue("gh") - .withFormat(ApiSpecImportSourceFormat.LINK) - .withSpecification( - new ApiSpecImportRequestSpecification().withName("qxvcxgfrpdsofb").withVersion("rnsvbuswd")), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListMockTests.java deleted file mode 100644 index 86074c1be568..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiDefinitionsListMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiDefinitionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"slol\",\"description\":\"pvuzlmv\",\"specification\":{\"name\":\"fktgplc\",\"version\":\"wjxeznoigbr\"}},\"id\":\"w\",\"name\":\"wkpnbsaz\",\"type\":\"jjoqkagf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.apiDefinitions() - .list("vmtgjqppy", "s", "ronzmyhgfip", "sxkm", "waekrrjreafxtsgu", "hjglikk", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("slol", response.iterator().next().properties().title()); - Assertions.assertEquals("pvuzlmv", response.iterator().next().properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiInnerTests.java deleted file mode 100644 index f88d70f3ebc3..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiInnerTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.ApiInner; -import com.azure.resourcemanager.apicenter.models.ApiKind; -import com.azure.resourcemanager.apicenter.models.ApiProperties; -import com.azure.resourcemanager.apicenter.models.Contact; -import com.azure.resourcemanager.apicenter.models.ExternalDocumentation; -import com.azure.resourcemanager.apicenter.models.License; -import com.azure.resourcemanager.apicenter.models.TermsOfService; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApiInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"nj\",\"kind\":\"soap\",\"description\":\"wtgrhpdjpj\",\"summary\":\"asxazjpqyegualhb\",\"lifecycleStage\":\"testing\",\"termsOfService\":{\"url\":\"jj\"},\"externalDocumentation\":[{\"title\":\"udgwdslfho\",\"description\":\"mcy\",\"url\":\"pwlbjnpg\"}],\"contacts\":[{\"name\":\"adehxnltyfsopp\",\"url\":\"uesnzwdejbavo\",\"email\":\"zdmohctbqvu\"},{\"name\":\"xdn\",\"url\":\"vo\",\"email\":\"ujjugwdkcglh\"},{\"name\":\"azjdyggd\",\"url\":\"ixhbkuofqweykhm\",\"email\":\"evfyexfwhybcib\"},{\"name\":\"vdcsitynn\",\"url\":\"mdectehfiqscjey\",\"email\":\"hezrkgq\"}],\"license\":{\"name\":\"refovgmkqsleyyvx\",\"url\":\"jpkcattpng\",\"identifier\":\"rcczsqpjhvmd\"},\"customProperties\":\"datav\"},\"id\":\"sounqecanoaeu\",\"name\":\"fhyhltrpmopjmcma\",\"type\":\"u\"}") - .toObject(ApiInner.class); - Assertions.assertEquals("nj", model.properties().title()); - Assertions.assertEquals(ApiKind.SOAP, model.properties().kind()); - Assertions.assertEquals("wtgrhpdjpj", model.properties().description()); - Assertions.assertEquals("asxazjpqyegualhb", model.properties().summary()); - Assertions.assertEquals("jj", model.properties().termsOfService().url()); - Assertions.assertEquals("udgwdslfho", model.properties().externalDocumentation().get(0).title()); - Assertions.assertEquals("mcy", model.properties().externalDocumentation().get(0).description()); - Assertions.assertEquals("pwlbjnpg", model.properties().externalDocumentation().get(0).url()); - Assertions.assertEquals("adehxnltyfsopp", model.properties().contacts().get(0).name()); - Assertions.assertEquals("uesnzwdejbavo", model.properties().contacts().get(0).url()); - Assertions.assertEquals("zdmohctbqvu", model.properties().contacts().get(0).email()); - Assertions.assertEquals("refovgmkqsleyyvx", model.properties().license().name()); - Assertions.assertEquals("jpkcattpng", model.properties().license().url()); - Assertions.assertEquals("rcczsqpjhvmd", model.properties().license().identifier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiInner model = new ApiInner().withProperties(new ApiProperties().withTitle("nj") - .withKind(ApiKind.SOAP) - .withDescription("wtgrhpdjpj") - .withSummary("asxazjpqyegualhb") - .withTermsOfService(new TermsOfService().withUrl("jj")) - .withExternalDocumentation(Arrays - .asList(new ExternalDocumentation().withTitle("udgwdslfho").withDescription("mcy").withUrl("pwlbjnpg"))) - .withContacts(Arrays.asList( - new Contact().withName("adehxnltyfsopp").withUrl("uesnzwdejbavo").withEmail("zdmohctbqvu"), - new Contact().withName("xdn").withUrl("vo").withEmail("ujjugwdkcglh"), - new Contact().withName("azjdyggd").withUrl("ixhbkuofqweykhm").withEmail("evfyexfwhybcib"), - new Contact().withName("vdcsitynn").withUrl("mdectehfiqscjey").withEmail("hezrkgq"))) - .withLicense( - new License().withName("refovgmkqsleyyvx").withUrl("jpkcattpng").withIdentifier("rcczsqpjhvmd")) - .withCustomProperties("datav")); - model = BinaryData.fromObject(model).toObject(ApiInner.class); - Assertions.assertEquals("nj", model.properties().title()); - Assertions.assertEquals(ApiKind.SOAP, model.properties().kind()); - Assertions.assertEquals("wtgrhpdjpj", model.properties().description()); - Assertions.assertEquals("asxazjpqyegualhb", model.properties().summary()); - Assertions.assertEquals("jj", model.properties().termsOfService().url()); - Assertions.assertEquals("udgwdslfho", model.properties().externalDocumentation().get(0).title()); - Assertions.assertEquals("mcy", model.properties().externalDocumentation().get(0).description()); - Assertions.assertEquals("pwlbjnpg", model.properties().externalDocumentation().get(0).url()); - Assertions.assertEquals("adehxnltyfsopp", model.properties().contacts().get(0).name()); - Assertions.assertEquals("uesnzwdejbavo", model.properties().contacts().get(0).url()); - Assertions.assertEquals("zdmohctbqvu", model.properties().contacts().get(0).email()); - Assertions.assertEquals("refovgmkqsleyyvx", model.properties().license().name()); - Assertions.assertEquals("jpkcattpng", model.properties().license().url()); - Assertions.assertEquals("rcczsqpjhvmd", model.properties().license().identifier()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiListResultTests.java deleted file mode 100644 index f1a2ba3336d9..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiListResult; - -public final class ApiListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"eiwaopvkmi\",\"kind\":\"graphql\",\"description\":\"mxdcufufsrp\",\"summary\":\"zidnsezcxtbzsgfy\",\"lifecycleStage\":\"development\",\"termsOfService\":{\"url\":\"ewmdw\"},\"externalDocumentation\":[{\"title\":\"ac\",\"description\":\"oosflnr\",\"url\":\"sfqpteehz\"},{\"title\":\"ypyqrimzinp\",\"description\":\"wjdk\",\"url\":\"rsoodqxhcrmnoh\"},{\"title\":\"ckwhds\",\"description\":\"fiyipjxsqwpgrj\",\"url\":\"znorcj\"},{\"title\":\"snb\",\"description\":\"qabnmoc\",\"url\":\"cyshurzafbljjgp\"}],\"contacts\":[{\"name\":\"c\",\"url\":\"klj\",\"email\":\"bqidtqaj\"}],\"license\":{\"name\":\"l\",\"url\":\"u\",\"identifier\":\"krlkhbzhfepg\"},\"customProperties\":\"dataqex\"},\"id\":\"ocxscpaierhhbcs\",\"name\":\"l\",\"type\":\"mmajtjaodx\"},{\"properties\":{\"title\":\"nbdxk\",\"kind\":\"rest\",\"description\":\"okaj\",\"summary\":\"npime\",\"lifecycleStage\":\"retired\",\"termsOfService\":{\"url\":\"xgcp\"},\"externalDocumentation\":[{\"title\":\"aajrm\",\"description\":\"jwzrl\",\"url\":\"vmclw\"},{\"title\":\"j\",\"description\":\"ejctbzaqsqsycb\",\"url\":\"bfkgukdkex\"}],\"contacts\":[{\"name\":\"fmxa\",\"url\":\"fjpgddtocjjxhvp\",\"email\":\"uexhdzx\"}],\"license\":{\"name\":\"eojnxqbzvddn\",\"url\":\"ndei\",\"identifier\":\"twnpzaoqvuhrhcf\"},\"customProperties\":\"datayd\"},\"id\":\"lmjthjq\",\"name\":\"wpyeicxmqciwqvh\",\"type\":\"hix\"},{\"properties\":{\"title\":\"gdtopbobjogh\",\"kind\":\"rest\",\"description\":\"u\",\"summary\":\"a\",\"lifecycleStage\":\"retired\",\"termsOfService\":{\"url\":\"ayvvtpgvdf\"},\"externalDocumentation\":[{\"title\":\"kftutqxlngxlefg\",\"description\":\"nxkrx\",\"url\":\"qmi\"},{\"title\":\"thz\",\"description\":\"qdrabhjybigehoqf\",\"url\":\"owskanyktz\"},{\"title\":\"u\",\"description\":\"wgqyw\",\"url\":\"ndrvynhzg\"},{\"title\":\"hrc\",\"description\":\"nc\",\"url\":\"cpecfvmmcoofs\"}],\"contacts\":[{\"name\":\"v\",\"url\":\"m\",\"email\":\"qabcypm\"},{\"name\":\"kwlzuvccfwnfn\",\"url\":\"cfionl\",\"email\":\"x\"}],\"license\":{\"name\":\"gtzxdpn\",\"url\":\"qqwx\",\"identifier\":\"feallnwsu\"},\"customProperties\":\"datasnjampmng\"},\"id\":\"scxaq\",\"name\":\"ooch\",\"type\":\"bonqvpkvlrxnjeas\"}],\"nextLink\":\"pheoflokeyy\"}") - .toObject(ApiListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiListResult model = new ApiListResult(); - model = BinaryData.fromObject(model).toObject(ApiListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiPropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiPropertiesTests.java deleted file mode 100644 index e90a98a0bc47..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiPropertiesTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiKind; -import com.azure.resourcemanager.apicenter.models.ApiProperties; -import com.azure.resourcemanager.apicenter.models.Contact; -import com.azure.resourcemanager.apicenter.models.ExternalDocumentation; -import com.azure.resourcemanager.apicenter.models.License; -import com.azure.resourcemanager.apicenter.models.TermsOfService; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApiPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiProperties model = BinaryData.fromString( - "{\"title\":\"kthfui\",\"kind\":\"rest\",\"description\":\"dsfcpkvxodpuoz\",\"summary\":\"zydagfuaxbezyiuo\",\"lifecycleStage\":\"deprecated\",\"termsOfService\":{\"url\":\"hrdxwzywqsmbs\"},\"externalDocumentation\":[{\"title\":\"imoryocfsfksym\",\"description\":\"ys\",\"url\":\"kiiuxhqyudxor\"}],\"contacts\":[{\"name\":\"poczvyifqrvkdvjs\",\"url\":\"rm\",\"email\":\"d\"},{\"name\":\"atkpnp\",\"url\":\"exxbczwtr\",\"email\":\"iqzbq\"},{\"name\":\"sovmyokacspkwl\",\"url\":\"dobpxjmflbvvn\",\"email\":\"rkcciwwzjuqk\"},{\"name\":\"sa\",\"url\":\"wkuofoskghsauu\",\"email\":\"jmvxie\"}],\"license\":{\"name\":\"gidyjrrf\",\"url\":\"aos\",\"identifier\":\"xc\"},\"customProperties\":\"datanpc\"}") - .toObject(ApiProperties.class); - Assertions.assertEquals("kthfui", model.title()); - Assertions.assertEquals(ApiKind.REST, model.kind()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.description()); - Assertions.assertEquals("zydagfuaxbezyiuo", model.summary()); - Assertions.assertEquals("hrdxwzywqsmbs", model.termsOfService().url()); - Assertions.assertEquals("imoryocfsfksym", model.externalDocumentation().get(0).title()); - Assertions.assertEquals("ys", model.externalDocumentation().get(0).description()); - Assertions.assertEquals("kiiuxhqyudxor", model.externalDocumentation().get(0).url()); - Assertions.assertEquals("poczvyifqrvkdvjs", model.contacts().get(0).name()); - Assertions.assertEquals("rm", model.contacts().get(0).url()); - Assertions.assertEquals("d", model.contacts().get(0).email()); - Assertions.assertEquals("gidyjrrf", model.license().name()); - Assertions.assertEquals("aos", model.license().url()); - Assertions.assertEquals("xc", model.license().identifier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiProperties model = new ApiProperties().withTitle("kthfui") - .withKind(ApiKind.REST) - .withDescription("dsfcpkvxodpuoz") - .withSummary("zydagfuaxbezyiuo") - .withTermsOfService(new TermsOfService().withUrl("hrdxwzywqsmbs")) - .withExternalDocumentation(Arrays.asList( - new ExternalDocumentation().withTitle("imoryocfsfksym").withDescription("ys").withUrl("kiiuxhqyudxor"))) - .withContacts(Arrays.asList(new Contact().withName("poczvyifqrvkdvjs").withUrl("rm").withEmail("d"), - new Contact().withName("atkpnp").withUrl("exxbczwtr").withEmail("iqzbq"), - new Contact().withName("sovmyokacspkwl").withUrl("dobpxjmflbvvn").withEmail("rkcciwwzjuqk"), - new Contact().withName("sa").withUrl("wkuofoskghsauu").withEmail("jmvxie"))) - .withLicense(new License().withName("gidyjrrf").withUrl("aos").withIdentifier("xc")) - .withCustomProperties("datanpc"); - model = BinaryData.fromObject(model).toObject(ApiProperties.class); - Assertions.assertEquals("kthfui", model.title()); - Assertions.assertEquals(ApiKind.REST, model.kind()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.description()); - Assertions.assertEquals("zydagfuaxbezyiuo", model.summary()); - Assertions.assertEquals("hrdxwzywqsmbs", model.termsOfService().url()); - Assertions.assertEquals("imoryocfsfksym", model.externalDocumentation().get(0).title()); - Assertions.assertEquals("ys", model.externalDocumentation().get(0).description()); - Assertions.assertEquals("kiiuxhqyudxor", model.externalDocumentation().get(0).url()); - Assertions.assertEquals("poczvyifqrvkdvjs", model.contacts().get(0).name()); - Assertions.assertEquals("rm", model.contacts().get(0).url()); - Assertions.assertEquals("d", model.contacts().get(0).email()); - Assertions.assertEquals("gidyjrrf", model.license().name()); - Assertions.assertEquals("aos", model.license().url()); - Assertions.assertEquals("xc", model.license().identifier()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecExportResultInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecExportResultInnerTests.java deleted file mode 100644 index efd5557742ce..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecExportResultInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.ApiSpecExportResultInner; -import com.azure.resourcemanager.apicenter.models.ApiSpecExportResultFormat; -import org.junit.jupiter.api.Assertions; - -public final class ApiSpecExportResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiSpecExportResultInner model - = BinaryData.fromString("{\"format\":\"link\",\"value\":\"v\"}").toObject(ApiSpecExportResultInner.class); - Assertions.assertEquals(ApiSpecExportResultFormat.LINK, model.format()); - Assertions.assertEquals("v", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiSpecExportResultInner model - = new ApiSpecExportResultInner().withFormat(ApiSpecExportResultFormat.LINK).withValue("v"); - model = BinaryData.fromObject(model).toObject(ApiSpecExportResultInner.class); - Assertions.assertEquals(ApiSpecExportResultFormat.LINK, model.format()); - Assertions.assertEquals("v", model.value()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecImportRequestSpecificationTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecImportRequestSpecificationTests.java deleted file mode 100644 index f646223eafde..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecImportRequestSpecificationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequestSpecification; -import org.junit.jupiter.api.Assertions; - -public final class ApiSpecImportRequestSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiSpecImportRequestSpecification model - = BinaryData.fromString("{\"name\":\"lmqkrhahvlj\",\"version\":\"haquhcdh\"}") - .toObject(ApiSpecImportRequestSpecification.class); - Assertions.assertEquals("lmqkrhahvlj", model.name()); - Assertions.assertEquals("haquhcdh", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiSpecImportRequestSpecification model - = new ApiSpecImportRequestSpecification().withName("lmqkrhahvlj").withVersion("haquhcdh"); - model = BinaryData.fromObject(model).toObject(ApiSpecImportRequestSpecification.class); - Assertions.assertEquals("lmqkrhahvlj", model.name()); - Assertions.assertEquals("haquhcdh", model.version()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecImportRequestTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecImportRequestTests.java deleted file mode 100644 index 888dfe198d2b..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiSpecImportRequestTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequest; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportRequestSpecification; -import com.azure.resourcemanager.apicenter.models.ApiSpecImportSourceFormat; -import org.junit.jupiter.api.Assertions; - -public final class ApiSpecImportRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiSpecImportRequest model = BinaryData.fromString( - "{\"value\":\"srtslhspkdeem\",\"format\":\"inline\",\"specification\":{\"name\":\"ag\",\"version\":\"t\"}}") - .toObject(ApiSpecImportRequest.class); - Assertions.assertEquals("srtslhspkdeem", model.value()); - Assertions.assertEquals(ApiSpecImportSourceFormat.INLINE, model.format()); - Assertions.assertEquals("ag", model.specification().name()); - Assertions.assertEquals("t", model.specification().version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiSpecImportRequest model = new ApiSpecImportRequest().withValue("srtslhspkdeem") - .withFormat(ApiSpecImportSourceFormat.INLINE) - .withSpecification(new ApiSpecImportRequestSpecification().withName("ag").withVersion("t")); - model = BinaryData.fromObject(model).toObject(ApiSpecImportRequest.class); - Assertions.assertEquals("srtslhspkdeem", model.value()); - Assertions.assertEquals(ApiSpecImportSourceFormat.INLINE, model.format()); - Assertions.assertEquals("ag", model.specification().name()); - Assertions.assertEquals("t", model.specification().version()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionInnerTests.java deleted file mode 100644 index 3399a61eab3e..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.ApiVersionInner; -import com.azure.resourcemanager.apicenter.models.ApiVersionProperties; -import com.azure.resourcemanager.apicenter.models.LifecycleStage; -import org.junit.jupiter.api.Assertions; - -public final class ApiVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiVersionInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"skpbhenbtkcxywn\",\"lifecycleStage\":\"design\"},\"id\":\"rsyn\",\"name\":\"qidybyx\",\"type\":\"zfcl\"}") - .toObject(ApiVersionInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.properties().title()); - Assertions.assertEquals(LifecycleStage.DESIGN, model.properties().lifecycleStage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiVersionInner model = new ApiVersionInner().withProperties( - new ApiVersionProperties().withTitle("skpbhenbtkcxywn").withLifecycleStage(LifecycleStage.DESIGN)); - model = BinaryData.fromObject(model).toObject(ApiVersionInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.properties().title()); - Assertions.assertEquals(LifecycleStage.DESIGN, model.properties().lifecycleStage()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionListResultTests.java deleted file mode 100644 index 1a752c3b32a2..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiVersionListResult; - -public final class ApiVersionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiVersionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"butr\",\"lifecycleStage\":\"design\"},\"id\":\"na\",\"name\":\"zmhjrunmp\",\"type\":\"ttdbhrbnl\"}],\"nextLink\":\"kx\"}") - .toObject(ApiVersionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiVersionListResult model = new ApiVersionListResult(); - model = BinaryData.fromObject(model).toObject(ApiVersionListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionPropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionPropertiesTests.java deleted file mode 100644 index 83bb68308270..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ApiVersionProperties; -import com.azure.resourcemanager.apicenter.models.LifecycleStage; -import org.junit.jupiter.api.Assertions; - -public final class ApiVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiVersionProperties model - = BinaryData.fromString("{\"title\":\"aaxdbabphlwrq\",\"lifecycleStage\":\"design\"}") - .toObject(ApiVersionProperties.class); - Assertions.assertEquals("aaxdbabphlwrq", model.title()); - Assertions.assertEquals(LifecycleStage.DESIGN, model.lifecycleStage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiVersionProperties model - = new ApiVersionProperties().withTitle("aaxdbabphlwrq").withLifecycleStage(LifecycleStage.DESIGN); - model = BinaryData.fromObject(model).toObject(ApiVersionProperties.class); - Assertions.assertEquals("aaxdbabphlwrq", model.title()); - Assertions.assertEquals(LifecycleStage.DESIGN, model.lifecycleStage()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 1bc6abf45b3e..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiVersion; -import com.azure.resourcemanager.apicenter.models.ApiVersionProperties; -import com.azure.resourcemanager.apicenter.models.LifecycleStage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiVersionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"reaxhcexdr\",\"lifecycleStage\":\"design\"},\"id\":\"ahqkg\",\"name\":\"tpwijnh\",\"type\":\"jsvfycxzbfvoowv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiVersion response = manager.apiVersions() - .define("bnhlmc") - .withExistingApi("wjygvjayvblmhvk", "uhbxvvy", "gsopbyrqufegxu", "wz") - .withProperties(new ApiVersionProperties().withTitle("p").withLifecycleStage(LifecycleStage.PRODUCTION)) - .create(); - - Assertions.assertEquals("reaxhcexdr", response.properties().title()); - Assertions.assertEquals(LifecycleStage.DESIGN, response.properties().lifecycleStage()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 09172da8e7b7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apiVersions() - .deleteWithResponse("qpcrf", "bwccsnjvcdwxlpqe", "ftnkhtj", "y", "ngwfqatm", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetWithResponseMockTests.java deleted file mode 100644 index fbd1221a7cb5..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiVersion; -import com.azure.resourcemanager.apicenter.models.LifecycleStage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"feo\",\"lifecycleStage\":\"development\"},\"id\":\"qwkyhkobop\",\"name\":\"xedk\",\"type\":\"wep\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiVersion response = manager.apiVersions() - .getWithResponse("wygzlvdnkfxusem", "wzrmuh", "pfcqdp", "qxqvpsvuoymgc", "elvezrypq", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("feo", response.properties().title()); - Assertions.assertEquals(LifecycleStage.DEVELOPMENT, response.properties().lifecycleStage()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadWithResponseMockTests.java deleted file mode 100644 index 5a2916cd1aab..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsHeadWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiVersionsHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apiVersions() - .headWithResponse("dhtmdvypgikd", "szywkbirryu", "hlhkjoqrvqqaatj", "nrvgoupmfiibfgg", "ioolvrwxkvtkkgll", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListMockTests.java deleted file mode 100644 index da1b4ad99d9d..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApiVersionsListMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ApiVersion; -import com.azure.resourcemanager.apicenter.models.LifecycleStage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApiVersionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"nvyq\",\"lifecycleStage\":\"preview\"},\"id\":\"kzwpcnpw\",\"name\":\"cjaesgvvs\",\"type\":\"cyajguqf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.apiVersions() - .list("hwhbotzingamv", "phoszqz", "dphqamv", "kfwynw", "vtbvkayh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nvyq", response.iterator().next().properties().title()); - Assertions.assertEquals(LifecycleStage.PREVIEW, response.iterator().next().properties().lifecycleStage()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index f69e81df9217..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Api; -import com.azure.resourcemanager.apicenter.models.ApiKind; -import com.azure.resourcemanager.apicenter.models.ApiProperties; -import com.azure.resourcemanager.apicenter.models.Contact; -import com.azure.resourcemanager.apicenter.models.ExternalDocumentation; -import com.azure.resourcemanager.apicenter.models.License; -import com.azure.resourcemanager.apicenter.models.TermsOfService; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApisCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"z\",\"kind\":\"graphql\",\"description\":\"rvexztvb\",\"summary\":\"gsfraoyzkoow\",\"lifecycleStage\":\"design\",\"termsOfService\":{\"url\":\"guxawqaldsyuuxi\"},\"externalDocumentation\":[{\"title\":\"fobwy\",\"description\":\"kby\",\"url\":\"utwpfhp\"}],\"contacts\":[{\"name\":\"r\",\"url\":\"dsnfdsdoakgtdl\",\"email\":\"kzevdlhewpusds\"}],\"license\":{\"name\":\"vogvbbejdcngqqmo\",\"url\":\"ufgmjzrwrdg\",\"identifier\":\"wae\"},\"customProperties\":\"datauzkopbminrfd\"},\"id\":\"yuhhziu\",\"name\":\"efozbhdms\",\"type\":\"l\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Api response = manager.apis() - .define("yhmlwpaztzp") - .withExistingWorkspace("zuempsbzkf", "beyvpnqicvinvkjj", "dxrbuukzcle") - .withProperties(new ApiProperties().withTitle("ncckw") - .withKind(ApiKind.REST) - .withDescription("qwhxxbuyqaxzfeqz") - .withSummary("priolx") - .withTermsOfService(new TermsOfService().withUrl("lt")) - .withExternalDocumentation(Arrays.asList( - new ExternalDocumentation().withTitle("cwsobqwcs") - .withDescription("nwdcfhu") - .withUrl("qdpfuvglsbjjca"), - new ExternalDocumentation().withTitle("xbvtvudu").withDescription("cormr").withUrl("xqtvcofu"), - new ExternalDocumentation().withTitle("lvkgju").withDescription("dknnqvsazn").withUrl("n"), - new ExternalDocumentation().withTitle("rudsg").withDescription("hmk").withUrl("c"))) - .withContacts( - Arrays.asList(new Contact().withName("wjue").withUrl("eburu").withEmail("movsmzlxwabmqoe"), - new Contact().withName("ifrvtpu").withUrl("jmqlgkfb").withEmail("doaon"), - new Contact().withName("jcntuj").withUrl("c").withEmail("df"))) - .withLicense(new License().withName("ae").withUrl("ojvdcpzfoqo").withIdentifier("cybxa")) - .withCustomProperties("datagszufoxciqopid")) - .create(); - - Assertions.assertEquals("z", response.properties().title()); - Assertions.assertEquals(ApiKind.GRAPHQL, response.properties().kind()); - Assertions.assertEquals("rvexztvb", response.properties().description()); - Assertions.assertEquals("gsfraoyzkoow", response.properties().summary()); - Assertions.assertEquals("guxawqaldsyuuxi", response.properties().termsOfService().url()); - Assertions.assertEquals("fobwy", response.properties().externalDocumentation().get(0).title()); - Assertions.assertEquals("kby", response.properties().externalDocumentation().get(0).description()); - Assertions.assertEquals("utwpfhp", response.properties().externalDocumentation().get(0).url()); - Assertions.assertEquals("r", response.properties().contacts().get(0).name()); - Assertions.assertEquals("dsnfdsdoakgtdl", response.properties().contacts().get(0).url()); - Assertions.assertEquals("kzevdlhewpusds", response.properties().contacts().get(0).email()); - Assertions.assertEquals("vogvbbejdcngqqmo", response.properties().license().name()); - Assertions.assertEquals("ufgmjzrwrdg", response.properties().license().url()); - Assertions.assertEquals("wae", response.properties().license().identifier()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteWithResponseMockTests.java deleted file mode 100644 index 21320a4bc3e5..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApisDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apis() - .deleteWithResponse("kooebwnu", "hemms", "vdkcrodtj", "nfwjlfltkacjvefk", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisGetWithResponseMockTests.java deleted file mode 100644 index 7654295682e9..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisGetWithResponseMockTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Api; -import com.azure.resourcemanager.apicenter.models.ApiKind; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApisGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"yjmoadsu\",\"kind\":\"soap\",\"description\":\"m\",\"summary\":\"dmjsjqb\",\"lifecycleStage\":\"deprecated\",\"termsOfService\":{\"url\":\"x\"},\"externalDocumentation\":[{\"title\":\"yc\",\"description\":\"uhpkxkgymar\",\"url\":\"qnajxqugj\"},{\"title\":\"ycubeddgs\",\"description\":\"fwqmzqalkrmn\",\"url\":\"i\"},{\"title\":\"xacqqudfnbyx\",\"description\":\"aabjyvayffimrz\",\"url\":\"tuzqogsexne\"},{\"title\":\"dnw\",\"description\":\"mewzsyyc\",\"url\":\"uzsoi\"}],\"contacts\":[{\"name\":\"pfrxtrthzvay\",\"url\":\"wkqbrqu\",\"email\":\"axhexiilivp\"}],\"license\":{\"name\":\"irqtdqoa\",\"url\":\"r\",\"identifier\":\"fgsqu\"},\"customProperties\":\"dataxrxxlep\"},\"id\":\"amxjezwlw\",\"name\":\"wxuqlcvydypatdoo\",\"type\":\"ojknio\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Api response = manager.apis() - .getWithResponse("gge", "dunyg", "eqidbqfatpx", "lr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("yjmoadsu", response.properties().title()); - Assertions.assertEquals(ApiKind.SOAP, response.properties().kind()); - Assertions.assertEquals("m", response.properties().description()); - Assertions.assertEquals("dmjsjqb", response.properties().summary()); - Assertions.assertEquals("x", response.properties().termsOfService().url()); - Assertions.assertEquals("yc", response.properties().externalDocumentation().get(0).title()); - Assertions.assertEquals("uhpkxkgymar", response.properties().externalDocumentation().get(0).description()); - Assertions.assertEquals("qnajxqugj", response.properties().externalDocumentation().get(0).url()); - Assertions.assertEquals("pfrxtrthzvay", response.properties().contacts().get(0).name()); - Assertions.assertEquals("wkqbrqu", response.properties().contacts().get(0).url()); - Assertions.assertEquals("axhexiilivp", response.properties().contacts().get(0).email()); - Assertions.assertEquals("irqtdqoa", response.properties().license().name()); - Assertions.assertEquals("r", response.properties().license().url()); - Assertions.assertEquals("fgsqu", response.properties().license().identifier()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisHeadWithResponseMockTests.java deleted file mode 100644 index e39b89c03dcd..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisHeadWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApisHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.apis() - .headWithResponse("lfoakg", "kfpagao", "pulpqblylsyxk", "jnsjervtiagxsd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisListMockTests.java deleted file mode 100644 index 58c26ffcdaf9..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ApisListMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Api; -import com.azure.resourcemanager.apicenter.models.ApiKind; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ApisListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"la\",\"kind\":\"graphql\",\"description\":\"lwuip\",\"summary\":\"cjzkzivgvvcna\",\"lifecycleStage\":\"development\",\"termsOfService\":{\"url\":\"rnxxmueed\"},\"externalDocumentation\":[{\"title\":\"v\",\"description\":\"kwqqtchealmf\",\"url\":\"tdaaygdvwvg\"},{\"title\":\"ohgwxrtfudxepxg\",\"description\":\"agvrvmnpkuk\",\"url\":\"himdbl\"},{\"title\":\"wi\",\"description\":\"njhf\",\"url\":\"xw\"}],\"contacts\":[{\"name\":\"kfoqreyfkzikfj\",\"url\":\"n\",\"email\":\"ivx\"}],\"license\":{\"name\":\"elpcirelsfeaenwa\",\"url\":\"atklddxbjhwuaa\",\"identifier\":\"zjosp\"},\"customProperties\":\"dataoulpjrv\"},\"id\":\"glrvimjwosytxi\",\"name\":\"cskfcktqumiekk\",\"type\":\"zzikhlyfjhdg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.apis() - .list("syocogjltdtbnnha", "oocrkvcikhnv", "amqgxqquezikyw", "gxk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("la", response.iterator().next().properties().title()); - Assertions.assertEquals(ApiKind.GRAPHQL, response.iterator().next().properties().kind()); - Assertions.assertEquals("lwuip", response.iterator().next().properties().description()); - Assertions.assertEquals("cjzkzivgvvcna", response.iterator().next().properties().summary()); - Assertions.assertEquals("rnxxmueed", response.iterator().next().properties().termsOfService().url()); - Assertions.assertEquals("v", response.iterator().next().properties().externalDocumentation().get(0).title()); - Assertions.assertEquals("kwqqtchealmf", - response.iterator().next().properties().externalDocumentation().get(0).description()); - Assertions.assertEquals("tdaaygdvwvg", - response.iterator().next().properties().externalDocumentation().get(0).url()); - Assertions.assertEquals("kfoqreyfkzikfj", response.iterator().next().properties().contacts().get(0).name()); - Assertions.assertEquals("n", response.iterator().next().properties().contacts().get(0).url()); - Assertions.assertEquals("ivx", response.iterator().next().properties().contacts().get(0).email()); - Assertions.assertEquals("elpcirelsfeaenwa", response.iterator().next().properties().license().name()); - Assertions.assertEquals("atklddxbjhwuaa", response.iterator().next().properties().license().url()); - Assertions.assertEquals("zjosp", response.iterator().next().properties().license().identifier()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ContactTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ContactTests.java deleted file mode 100644 index d543a62db090..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ContactTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.Contact; -import org.junit.jupiter.api.Assertions; - -public final class ContactTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Contact model = BinaryData - .fromString("{\"name\":\"hxmzsbbzoggig\",\"url\":\"wburvjxxjnspydpt\",\"email\":\"enkouknvudw\"}") - .toObject(Contact.class); - Assertions.assertEquals("hxmzsbbzoggig", model.name()); - Assertions.assertEquals("wburvjxxjnspydpt", model.url()); - Assertions.assertEquals("enkouknvudw", model.email()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Contact model = new Contact().withName("hxmzsbbzoggig").withUrl("wburvjxxjnspydpt").withEmail("enkouknvudw"); - model = BinaryData.fromObject(model).toObject(Contact.class); - Assertions.assertEquals("hxmzsbbzoggig", model.name()); - Assertions.assertEquals("wburvjxxjnspydpt", model.url()); - Assertions.assertEquals("enkouknvudw", model.email()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentInnerTests.java deleted file mode 100644 index 39f3a98c41e6..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.DeploymentInner; -import com.azure.resourcemanager.apicenter.models.DeploymentProperties; -import com.azure.resourcemanager.apicenter.models.DeploymentServer; -import com.azure.resourcemanager.apicenter.models.DeploymentState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"ihkaetcktvfc\",\"description\":\"fsnkymuctq\",\"environmentId\":\"fbebrjcxer\",\"definitionId\":\"wutttxfvjrbi\",\"state\":\"inactive\",\"server\":{\"runtimeUri\":[\"c\",\"vahfn\",\"jky\",\"xjvuujqgidokg\"]},\"customProperties\":\"datajyoxgvclt\"},\"id\":\"sncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"}") - .toObject(DeploymentInner.class); - Assertions.assertEquals("ihkaetcktvfc", model.properties().title()); - Assertions.assertEquals("fsnkymuctq", model.properties().description()); - Assertions.assertEquals("fbebrjcxer", model.properties().environmentId()); - Assertions.assertEquals("wutttxfvjrbi", model.properties().definitionId()); - Assertions.assertEquals(DeploymentState.INACTIVE, model.properties().state()); - Assertions.assertEquals("c", model.properties().server().runtimeUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentInner model - = new DeploymentInner().withProperties(new DeploymentProperties().withTitle("ihkaetcktvfc") - .withDescription("fsnkymuctq") - .withEnvironmentId("fbebrjcxer") - .withDefinitionId("wutttxfvjrbi") - .withState(DeploymentState.INACTIVE) - .withServer(new DeploymentServer().withRuntimeUri(Arrays.asList("c", "vahfn", "jky", "xjvuujqgidokg"))) - .withCustomProperties("datajyoxgvclt")); - model = BinaryData.fromObject(model).toObject(DeploymentInner.class); - Assertions.assertEquals("ihkaetcktvfc", model.properties().title()); - Assertions.assertEquals("fsnkymuctq", model.properties().description()); - Assertions.assertEquals("fbebrjcxer", model.properties().environmentId()); - Assertions.assertEquals("wutttxfvjrbi", model.properties().definitionId()); - Assertions.assertEquals(DeploymentState.INACTIVE, model.properties().state()); - Assertions.assertEquals("c", model.properties().server().runtimeUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentListResultTests.java deleted file mode 100644 index 791ae506aa1f..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.DeploymentListResult; - -public final class DeploymentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"evqzntypmrbp\",\"description\":\"c\",\"environmentId\":\"qjsdpydnfyhxdeo\",\"definitionId\":\"zi\",\"state\":\"inactive\",\"server\":{\"runtimeUri\":[\"ttgzfbis\",\"cbkhajdeyeamdph\"]},\"customProperties\":\"dataalpbuxwgipwhon\"},\"id\":\"kgshwa\",\"name\":\"kix\",\"type\":\"bin\"},{\"properties\":{\"title\":\"uttmrywnuzoqft\",\"description\":\"qzrnkcqvyxlwhz\",\"environmentId\":\"icohoqqnwvl\",\"definitionId\":\"avwhheunm\",\"state\":\"inactive\",\"server\":{\"runtimeUri\":[\"zko\"]},\"customProperties\":\"datacukoklyaxuconu\"},\"id\":\"zf\",\"name\":\"beypewrmjmw\",\"type\":\"vjektcxsenh\"}],\"nextLink\":\"rsffrzpwvlqdqgbi\"}") - .toObject(DeploymentListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentListResult model = new DeploymentListResult(); - model = BinaryData.fromObject(model).toObject(DeploymentListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentPropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentPropertiesTests.java deleted file mode 100644 index 435afd385c18..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.DeploymentProperties; -import com.azure.resourcemanager.apicenter.models.DeploymentServer; -import com.azure.resourcemanager.apicenter.models.DeploymentState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentProperties model = BinaryData.fromString( - "{\"title\":\"cxgod\",\"description\":\"fqkkr\",\"environmentId\":\"pukgriwflzlfb\",\"definitionId\":\"puz\",\"state\":\"inactive\",\"server\":{\"runtimeUri\":[\"qzahmgkbrp\",\"y\",\"hibnuqqkpika\",\"rgvtqag\"]},\"customProperties\":\"datauynhijg\"}") - .toObject(DeploymentProperties.class); - Assertions.assertEquals("cxgod", model.title()); - Assertions.assertEquals("fqkkr", model.description()); - Assertions.assertEquals("pukgriwflzlfb", model.environmentId()); - Assertions.assertEquals("puz", model.definitionId()); - Assertions.assertEquals(DeploymentState.INACTIVE, model.state()); - Assertions.assertEquals("qzahmgkbrp", model.server().runtimeUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentProperties model = new DeploymentProperties().withTitle("cxgod") - .withDescription("fqkkr") - .withEnvironmentId("pukgriwflzlfb") - .withDefinitionId("puz") - .withState(DeploymentState.INACTIVE) - .withServer( - new DeploymentServer().withRuntimeUri(Arrays.asList("qzahmgkbrp", "y", "hibnuqqkpika", "rgvtqag"))) - .withCustomProperties("datauynhijg"); - model = BinaryData.fromObject(model).toObject(DeploymentProperties.class); - Assertions.assertEquals("cxgod", model.title()); - Assertions.assertEquals("fqkkr", model.description()); - Assertions.assertEquals("pukgriwflzlfb", model.environmentId()); - Assertions.assertEquals("puz", model.definitionId()); - Assertions.assertEquals(DeploymentState.INACTIVE, model.state()); - Assertions.assertEquals("qzahmgkbrp", model.server().runtimeUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentServerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentServerTests.java deleted file mode 100644 index c297f1c5cb5e..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentServerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.DeploymentServer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeploymentServerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeploymentServer model = BinaryData.fromString("{\"runtimeUri\":[\"bfs\"]}").toObject(DeploymentServer.class); - Assertions.assertEquals("bfs", model.runtimeUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentServer model = new DeploymentServer().withRuntimeUri(Arrays.asList("bfs")); - model = BinaryData.fromObject(model).toObject(DeploymentServer.class); - Assertions.assertEquals("bfs", model.runtimeUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index a3040aaf4b1c..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Deployment; -import com.azure.resourcemanager.apicenter.models.DeploymentProperties; -import com.azure.resourcemanager.apicenter.models.DeploymentServer; -import com.azure.resourcemanager.apicenter.models.DeploymentState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"pfrlazsz\",\"description\":\"woiindf\",\"environmentId\":\"pj\",\"definitionId\":\"wbtlhflsjcdh\",\"state\":\"inactive\",\"server\":{\"runtimeUri\":[\"bgofeljag\",\"qmqhldvriii\",\"jnalghf\",\"vtvsexsowueluq\"]},\"customProperties\":\"dataahhxvrh\"},\"id\":\"kwpjgwwspughftqs\",\"name\":\"hqxujxukndxdi\",\"type\":\"rjguufzdmsyqtf\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = manager.deployments() - .define("bizikayuhq") - .withExistingApi("vncjabudurgk", "kmokz", "jjklff", "mouwqlgzrfzeey") - .withProperties(new DeploymentProperties().withTitle("bs") - .withDescription("bqwrvtldgm") - .withEnvironmentId("gvmpipaslthaqfx") - .withDefinitionId("mwutwbdsre") - .withState(DeploymentState.INACTIVE) - .withServer(new DeploymentServer().withRuntimeUri(Arrays.asList("euyowqkd", "ytisibir"))) - .withCustomProperties("datapikpz")) - .create(); - - Assertions.assertEquals("pfrlazsz", response.properties().title()); - Assertions.assertEquals("woiindf", response.properties().description()); - Assertions.assertEquals("pj", response.properties().environmentId()); - Assertions.assertEquals("wbtlhflsjcdh", response.properties().definitionId()); - Assertions.assertEquals(DeploymentState.INACTIVE, response.properties().state()); - Assertions.assertEquals("bgofeljag", response.properties().server().runtimeUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteWithResponseMockTests.java deleted file mode 100644 index d5c438680551..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deployments() - .deleteWithResponse("g", "vfvpdbodaciz", "j", "lhkrribdeibqipqk", "hvxndzwmkrefajpj", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetWithResponseMockTests.java deleted file mode 100644 index 4d3f78e3f90d..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Deployment; -import com.azure.resourcemanager.apicenter.models.DeploymentState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"w\",\"description\":\"r\",\"environmentId\":\"swibyr\",\"definitionId\":\"l\",\"state\":\"inactive\",\"server\":{\"runtimeUri\":[\"p\",\"acstwityk\",\"evxccedcp\",\"md\"]},\"customProperties\":\"datadnwzxltjcvnhltiu\"},\"id\":\"xnavvwxq\",\"name\":\"byqunyow\",\"type\":\"wlmdjrkv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = manager.deployments() - .getWithResponse("eadcygqukyhejhz", "sx", "fpel", "lppvksrpq", "ujzra", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("w", response.properties().title()); - Assertions.assertEquals("r", response.properties().description()); - Assertions.assertEquals("swibyr", response.properties().environmentId()); - Assertions.assertEquals("l", response.properties().definitionId()); - Assertions.assertEquals(DeploymentState.INACTIVE, response.properties().state()); - Assertions.assertEquals("p", response.properties().server().runtimeUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadWithResponseMockTests.java deleted file mode 100644 index 7897bd1d6841..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsHeadWithResponseMockTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deployments() - .headWithResponse("rwkq", "yhgbijtjivfx", "sjabibs", "stawfsdjpvkv", "bjxbkzbzk", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListMockTests.java deleted file mode 100644 index ea8d9d75ab9d..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/DeploymentsListMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Deployment; -import com.azure.resourcemanager.apicenter.models.DeploymentState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"ivwitqscywugg\",\"description\":\"luhczbw\",\"environmentId\":\"hairsbrgzdwms\",\"definitionId\":\"ypqwdxggiccc\",\"state\":\"active\",\"server\":{\"runtimeUri\":[\"xmkttl\"]},\"customProperties\":\"datavlz\"},\"id\":\"emhzrncsdtc\",\"name\":\"u\",\"type\":\"iypbsfgytgusl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.deployments() - .list("zqhof", "rmaequ", "ah", "icslfaoq", "piyylhalnswhccsp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ivwitqscywugg", response.iterator().next().properties().title()); - Assertions.assertEquals("luhczbw", response.iterator().next().properties().description()); - Assertions.assertEquals("hairsbrgzdwms", response.iterator().next().properties().environmentId()); - Assertions.assertEquals("ypqwdxggiccc", response.iterator().next().properties().definitionId()); - Assertions.assertEquals(DeploymentState.ACTIVE, response.iterator().next().properties().state()); - Assertions.assertEquals("xmkttl", response.iterator().next().properties().server().runtimeUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentInnerTests.java deleted file mode 100644 index 460d0f0eafc2..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.EnvironmentInner; -import com.azure.resourcemanager.apicenter.models.EnvironmentKind; -import com.azure.resourcemanager.apicenter.models.EnvironmentProperties; -import com.azure.resourcemanager.apicenter.models.EnvironmentServer; -import com.azure.resourcemanager.apicenter.models.EnvironmentServerType; -import com.azure.resourcemanager.apicenter.models.Onboarding; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"zjuzgwyz\",\"description\":\"txon\",\"kind\":\"production\",\"server\":{\"type\":\"MuleSoft API Management\",\"managementPortalUri\":[\"cbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\",\"bexrmcq\"]},\"onboarding\":{\"instructions\":\"cnojvknmefqsg\",\"developerPortalUri\":[\"hapjyzhpvgqz\"]},\"customProperties\":\"datarvxdjzlmw\"},\"id\":\"kvugfhzovawjvzun\",\"name\":\"uthnnprnxipeilpj\",\"type\":\"uaejxdultsk\"}") - .toObject(EnvironmentInner.class); - Assertions.assertEquals("zjuzgwyz", model.properties().title()); - Assertions.assertEquals("txon", model.properties().description()); - Assertions.assertEquals(EnvironmentKind.PRODUCTION, model.properties().kind()); - Assertions.assertEquals(EnvironmentServerType.MULE_SOFT_API_MANAGEMENT, model.properties().server().type()); - Assertions.assertEquals("cbpwxqpsrknft", model.properties().server().managementPortalUri().get(0)); - Assertions.assertEquals("cnojvknmefqsg", model.properties().onboarding().instructions()); - Assertions.assertEquals("hapjyzhpvgqz", model.properties().onboarding().developerPortalUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentInner model = new EnvironmentInner().withProperties(new EnvironmentProperties().withTitle("zjuzgwyz") - .withDescription("txon") - .withKind(EnvironmentKind.PRODUCTION) - .withServer(new EnvironmentServer().withType(EnvironmentServerType.MULE_SOFT_API_MANAGEMENT) - .withManagementPortalUri(Arrays.asList("cbpwxqpsrknft", "uvriuhprwm", "yvxqtayriwwroy", "bexrmcq"))) - .withOnboarding(new Onboarding().withInstructions("cnojvknmefqsg") - .withDeveloperPortalUri(Arrays.asList("hapjyzhpvgqz"))) - .withCustomProperties("datarvxdjzlmw")); - model = BinaryData.fromObject(model).toObject(EnvironmentInner.class); - Assertions.assertEquals("zjuzgwyz", model.properties().title()); - Assertions.assertEquals("txon", model.properties().description()); - Assertions.assertEquals(EnvironmentKind.PRODUCTION, model.properties().kind()); - Assertions.assertEquals(EnvironmentServerType.MULE_SOFT_API_MANAGEMENT, model.properties().server().type()); - Assertions.assertEquals("cbpwxqpsrknft", model.properties().server().managementPortalUri().get(0)); - Assertions.assertEquals("cnojvknmefqsg", model.properties().onboarding().instructions()); - Assertions.assertEquals("hapjyzhpvgqz", model.properties().onboarding().developerPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentListResultTests.java deleted file mode 100644 index fbb084a8fba6..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.EnvironmentListResult; - -public final class EnvironmentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"alaexqpvfadmwsrc\",\"description\":\"vxpvgomz\",\"kind\":\"testing\",\"server\":{\"type\":\"Azure compute service\",\"managementPortalUri\":[\"bnbbeldawkz\"]},\"onboarding\":{\"instructions\":\"io\",\"developerPortalUri\":[\"hakauhashsf\",\"xosow\",\"xcug\"]},\"customProperties\":\"datajooxdjebw\"},\"id\":\"cwwfvovbvme\",\"name\":\"ecivyh\",\"type\":\"ce\"},{\"properties\":{\"title\":\"jgjrwjueiotwm\",\"description\":\"ytdxwit\",\"kind\":\"staging\",\"server\":{\"type\":\"Kong API Gateway\",\"managementPortalUri\":[\"qwgxhniskx\",\"bkpyc\",\"klwndnhjdauwhv\",\"l\"]},\"onboarding\":{\"instructions\":\"tdhxujznbmpowuwp\",\"developerPortalUri\":[\"lve\",\"alupjm\",\"hfxobbcswsrtj\",\"iplrbpbewtghfgb\"]},\"customProperties\":\"datagw\"},\"id\":\"vlvqhjkbegi\",\"name\":\"t\",\"type\":\"mxiebw\"}],\"nextLink\":\"loayqcgw\"}") - .toObject(EnvironmentListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentListResult model = new EnvironmentListResult(); - model = BinaryData.fromObject(model).toObject(EnvironmentListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentPropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentPropertiesTests.java deleted file mode 100644 index c5e58898dd98..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.EnvironmentKind; -import com.azure.resourcemanager.apicenter.models.EnvironmentProperties; -import com.azure.resourcemanager.apicenter.models.EnvironmentServer; -import com.azure.resourcemanager.apicenter.models.EnvironmentServerType; -import com.azure.resourcemanager.apicenter.models.Onboarding; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentProperties model = BinaryData.fromString( - "{\"title\":\"bbtdzumvee\",\"description\":\"pwo\",\"kind\":\"development\",\"server\":{\"type\":\"Kubernetes\",\"managementPortalUri\":[\"sjyofdx\",\"uusdttouwa\"]},\"onboarding\":{\"instructions\":\"kqvkelnsmvbxwyjs\",\"developerPortalUri\":[\"hcaalnjix\",\"sxyawjoyaqcs\"]},\"customProperties\":\"datajpkiidzyexznelix\"}") - .toObject(EnvironmentProperties.class); - Assertions.assertEquals("bbtdzumvee", model.title()); - Assertions.assertEquals("pwo", model.description()); - Assertions.assertEquals(EnvironmentKind.DEVELOPMENT, model.kind()); - Assertions.assertEquals(EnvironmentServerType.KUBERNETES, model.server().type()); - Assertions.assertEquals("sjyofdx", model.server().managementPortalUri().get(0)); - Assertions.assertEquals("kqvkelnsmvbxwyjs", model.onboarding().instructions()); - Assertions.assertEquals("hcaalnjix", model.onboarding().developerPortalUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentProperties model = new EnvironmentProperties().withTitle("bbtdzumvee") - .withDescription("pwo") - .withKind(EnvironmentKind.DEVELOPMENT) - .withServer(new EnvironmentServer().withType(EnvironmentServerType.KUBERNETES) - .withManagementPortalUri(Arrays.asList("sjyofdx", "uusdttouwa"))) - .withOnboarding(new Onboarding().withInstructions("kqvkelnsmvbxwyjs") - .withDeveloperPortalUri(Arrays.asList("hcaalnjix", "sxyawjoyaqcs"))) - .withCustomProperties("datajpkiidzyexznelix"); - model = BinaryData.fromObject(model).toObject(EnvironmentProperties.class); - Assertions.assertEquals("bbtdzumvee", model.title()); - Assertions.assertEquals("pwo", model.description()); - Assertions.assertEquals(EnvironmentKind.DEVELOPMENT, model.kind()); - Assertions.assertEquals(EnvironmentServerType.KUBERNETES, model.server().type()); - Assertions.assertEquals("sjyofdx", model.server().managementPortalUri().get(0)); - Assertions.assertEquals("kqvkelnsmvbxwyjs", model.onboarding().instructions()); - Assertions.assertEquals("hcaalnjix", model.onboarding().developerPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentServerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentServerTests.java deleted file mode 100644 index 2c94cad09778..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentServerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.EnvironmentServer; -import com.azure.resourcemanager.apicenter.models.EnvironmentServerType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentServerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentServer model = BinaryData - .fromString("{\"type\":\"AWS API Gateway\",\"managementPortalUri\":[\"folhbnxknal\",\"ulppggdtpnapnyir\"]}") - .toObject(EnvironmentServer.class); - Assertions.assertEquals(EnvironmentServerType.AWS_API_GATEWAY, model.type()); - Assertions.assertEquals("folhbnxknal", model.managementPortalUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentServer model = new EnvironmentServer().withType(EnvironmentServerType.AWS_API_GATEWAY) - .withManagementPortalUri(Arrays.asList("folhbnxknal", "ulppggdtpnapnyir")); - model = BinaryData.fromObject(model).toObject(EnvironmentServer.class); - Assertions.assertEquals(EnvironmentServerType.AWS_API_GATEWAY, model.type()); - Assertions.assertEquals("folhbnxknal", model.managementPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index dbf0d85c59d9..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Environment; -import com.azure.resourcemanager.apicenter.models.EnvironmentKind; -import com.azure.resourcemanager.apicenter.models.EnvironmentProperties; -import com.azure.resourcemanager.apicenter.models.EnvironmentServer; -import com.azure.resourcemanager.apicenter.models.EnvironmentServerType; -import com.azure.resourcemanager.apicenter.models.Onboarding; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"vewzcj\",\"description\":\"m\",\"kind\":\"production\",\"server\":{\"type\":\"Kong API Gateway\",\"managementPortalUri\":[\"adraufactkahzo\",\"ajjziuxxpshne\",\"kulfg\",\"lqubkwdlen\"]},\"onboarding\":{\"instructions\":\"utujba\",\"developerPortalUri\":[\"uo\",\"minyflnorwm\",\"uvwpklvxwmyg\",\"xpgpq\"]},\"customProperties\":\"dataisze\"},\"id\":\"nb\",\"name\":\"crxgibb\",\"type\":\"axconfozauo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Environment response = manager.environments() - .define("coezbrhubskh") - .withExistingWorkspace("qkdlw", "qfbumlkxtrqjf", "mlmbtxhwgfwsrta") - .withProperties(new EnvironmentProperties().withTitle("ygo") - .withDescription("kkqfqjbvle") - .withKind(EnvironmentKind.STAGING) - .withServer(new EnvironmentServer().withType(EnvironmentServerType.KONG_API_GATEWAY) - .withManagementPortalUri(Arrays.asList("qtqzfavyv", "qqybarye", "ayjkqa"))) - .withOnboarding(new Onboarding().withInstructions("zslesjcbher") - .withDeveloperPortalUri(Arrays.asList("iew", "jcvb"))) - .withCustomProperties("datawr")) - .create(); - - Assertions.assertEquals("vewzcj", response.properties().title()); - Assertions.assertEquals("m", response.properties().description()); - Assertions.assertEquals(EnvironmentKind.PRODUCTION, response.properties().kind()); - Assertions.assertEquals(EnvironmentServerType.KONG_API_GATEWAY, response.properties().server().type()); - Assertions.assertEquals("adraufactkahzo", response.properties().server().managementPortalUri().get(0)); - Assertions.assertEquals("utujba", response.properties().onboarding().instructions()); - Assertions.assertEquals("uo", response.properties().onboarding().developerPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteWithResponseMockTests.java deleted file mode 100644 index 8ed7c9d806c7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.environments() - .deleteWithResponse("kgxywr", "kpyklyhp", "uodpv", "uudl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetWithResponseMockTests.java deleted file mode 100644 index a955b75e7ea4..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Environment; -import com.azure.resourcemanager.apicenter.models.EnvironmentKind; -import com.azure.resourcemanager.apicenter.models.EnvironmentServerType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"rhnj\",\"description\":\"olvtnovqfzge\",\"kind\":\"staging\",\"server\":{\"type\":\"AWS API Gateway\",\"managementPortalUri\":[\"jltduceam\",\"mczuo\",\"ejwcwwqiok\"]},\"onboarding\":{\"instructions\":\"xmojmsvpkjp\",\"developerPortalUri\":[\"wcfzqljyxgt\"]},\"customProperties\":\"dataheyd\"},\"id\":\"dshmkxmaehvbbx\",\"name\":\"ripltf\",\"type\":\"htba\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Environment response = manager.environments() - .getWithResponse("nrnrp", "ehuwrykqgaifmvik", "bydvkhbejdz", "xcv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rhnj", response.properties().title()); - Assertions.assertEquals("olvtnovqfzge", response.properties().description()); - Assertions.assertEquals(EnvironmentKind.STAGING, response.properties().kind()); - Assertions.assertEquals(EnvironmentServerType.AWS_API_GATEWAY, response.properties().server().type()); - Assertions.assertEquals("jltduceam", response.properties().server().managementPortalUri().get(0)); - Assertions.assertEquals("xmojmsvpkjp", response.properties().onboarding().instructions()); - Assertions.assertEquals("wcfzqljyxgt", response.properties().onboarding().developerPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadWithResponseMockTests.java deleted file mode 100644 index 0a9ed96e34e8..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsHeadWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentsHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.environments() - .headWithResponse("zibt", "ostgkts", "vdxec", "zedqbcvhzlhplo", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListMockTests.java deleted file mode 100644 index b8235b99a4eb..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/EnvironmentsListMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Environment; -import com.azure.resourcemanager.apicenter.models.EnvironmentKind; -import com.azure.resourcemanager.apicenter.models.EnvironmentServerType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EnvironmentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"lw\",\"description\":\"esutrgjupauutpw\",\"kind\":\"development\",\"server\":{\"type\":\"Kong API Gateway\",\"managementPortalUri\":[\"qg\",\"zpnfqntcypsxj\"]},\"onboarding\":{\"instructions\":\"imwkslircizj\",\"developerPortalUri\":[\"dfcea\",\"vlhv\"]},\"customProperties\":\"datadyftumrtwna\"},\"id\":\"slbi\",\"name\":\"kojgcyzts\",\"type\":\"mznbaeqphch\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.environments() - .list("asdvl", "fwdgzxulucvp", "mrsreuzvxurisjnh", "ytxifqjzgxmrh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lw", response.iterator().next().properties().title()); - Assertions.assertEquals("esutrgjupauutpw", response.iterator().next().properties().description()); - Assertions.assertEquals(EnvironmentKind.DEVELOPMENT, response.iterator().next().properties().kind()); - Assertions.assertEquals(EnvironmentServerType.KONG_API_GATEWAY, - response.iterator().next().properties().server().type()); - Assertions.assertEquals("qg", response.iterator().next().properties().server().managementPortalUri().get(0)); - Assertions.assertEquals("imwkslircizj", response.iterator().next().properties().onboarding().instructions()); - Assertions.assertEquals("dfcea", - response.iterator().next().properties().onboarding().developerPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ExternalDocumentationTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ExternalDocumentationTests.java deleted file mode 100644 index 4b3309825c0e..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ExternalDocumentationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ExternalDocumentation; -import org.junit.jupiter.api.Assertions; - -public final class ExternalDocumentationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalDocumentation model - = BinaryData.fromString("{\"title\":\"ggzfbu\",\"description\":\"mvfaxkffeiith\",\"url\":\"vmezy\"}") - .toObject(ExternalDocumentation.class); - Assertions.assertEquals("ggzfbu", model.title()); - Assertions.assertEquals("mvfaxkffeiith", model.description()); - Assertions.assertEquals("vmezy", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalDocumentation model - = new ExternalDocumentation().withTitle("ggzfbu").withDescription("mvfaxkffeiith").withUrl("vmezy"); - model = BinaryData.fromObject(model).toObject(ExternalDocumentation.class); - Assertions.assertEquals("ggzfbu", model.title()); - Assertions.assertEquals("mvfaxkffeiith", model.description()); - Assertions.assertEquals("vmezy", model.url()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/LicenseTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/LicenseTests.java deleted file mode 100644 index fb81b9e046e5..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/LicenseTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.License; -import org.junit.jupiter.api.Assertions; - -public final class LicenseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - License model - = BinaryData.fromString("{\"name\":\"ukbldngkpo\",\"url\":\"pazyxoegukg\",\"identifier\":\"piu\"}") - .toObject(License.class); - Assertions.assertEquals("ukbldngkpo", model.name()); - Assertions.assertEquals("pazyxoegukg", model.url()); - Assertions.assertEquals("piu", model.identifier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - License model = new License().withName("ukbldngkpo").withUrl("pazyxoegukg").withIdentifier("piu"); - model = BinaryData.fromObject(model).toObject(License.class); - Assertions.assertEquals("ukbldngkpo", model.name()); - Assertions.assertEquals("pazyxoegukg", model.url()); - Assertions.assertEquals("piu", model.identifier()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ManagedServiceIdentityTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 6e1f84b3d3c7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"7e107806-0899-4200-98e6-18a6355ea91a\",\"tenantId\":\"6258fc30-d9af-4c4a-b4e7-1927cd89c4a2\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"fxxypininmayhuy\":{\"principalId\":\"ef37db9a-7305-4f99-abda-1e70a95dfb91\",\"clientId\":\"373ca455-594e-4f3f-b5d3-8439dbb808a4\"},\"podepoo\":{\"principalId\":\"34fdeabf-ccae-4b77-8c08-aa806827e17e\",\"clientId\":\"080e1b57-1fbc-4305-a71f-dbccc5613708\"},\"uvamiheognarxzxt\":{\"principalId\":\"25f9fdbd-c0f3-4ce5-9c0c-bc2a9530d761\",\"clientId\":\"6d5c39ff-0046-4755-966a-4d320861400a\"},\"tusivyevcciqihn\":{\"principalId\":\"9a3cea45-0a45-4192-8da0-9a4a4849c2d8\",\"clientId\":\"9bcffa88-c7d0-4bff-ba01-45e85d4a8c40\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("fxxypininmayhuy", new UserAssignedIdentity(), "podepoo", new UserAssignedIdentity(), - "uvamiheognarxzxt", new UserAssignedIdentity(), "tusivyevcciqihn", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataAssignmentTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataAssignmentTests.java deleted file mode 100644 index d49f307454f4..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataAssignmentTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.MetadataAssignment; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import org.junit.jupiter.api.Assertions; - -public final class MetadataAssignmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataAssignment model - = BinaryData.fromString("{\"entity\":\"deployment\",\"required\":true,\"deprecated\":true}") - .toObject(MetadataAssignment.class); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, model.entity()); - Assertions.assertEquals(true, model.required()); - Assertions.assertEquals(true, model.deprecated()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataAssignment model = new MetadataAssignment().withEntity(MetadataAssignmentEntity.DEPLOYMENT) - .withRequired(true) - .withDeprecated(true); - model = BinaryData.fromObject(model).toObject(MetadataAssignment.class); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, model.entity()); - Assertions.assertEquals(true, model.required()); - Assertions.assertEquals(true, model.deprecated()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaExportRequestTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaExportRequestTests.java deleted file mode 100644 index bfb741cc975d..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaExportRequestTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportRequest; -import org.junit.jupiter.api.Assertions; - -public final class MetadataSchemaExportRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataSchemaExportRequest model - = BinaryData.fromString("{\"assignedTo\":\"environment\"}").toObject(MetadataSchemaExportRequest.class); - Assertions.assertEquals(MetadataAssignmentEntity.ENVIRONMENT, model.assignedTo()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataSchemaExportRequest model - = new MetadataSchemaExportRequest().withAssignedTo(MetadataAssignmentEntity.ENVIRONMENT); - model = BinaryData.fromObject(model).toObject(MetadataSchemaExportRequest.class); - Assertions.assertEquals(MetadataAssignmentEntity.ENVIRONMENT, model.assignedTo()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaExportResultInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaExportResultInnerTests.java deleted file mode 100644 index b84cad07fbd7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaExportResultInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.MetadataSchemaExportResultInner; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportFormat; -import org.junit.jupiter.api.Assertions; - -public final class MetadataSchemaExportResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataSchemaExportResultInner model - = BinaryData.fromString("{\"format\":\"inline\",\"value\":\"cwrwclxxwrljdous\"}") - .toObject(MetadataSchemaExportResultInner.class); - Assertions.assertEquals(MetadataSchemaExportFormat.INLINE, model.format()); - Assertions.assertEquals("cwrwclxxwrljdous", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataSchemaExportResultInner model - = new MetadataSchemaExportResultInner().withFormat(MetadataSchemaExportFormat.INLINE) - .withValue("cwrwclxxwrljdous"); - model = BinaryData.fromObject(model).toObject(MetadataSchemaExportResultInner.class); - Assertions.assertEquals(MetadataSchemaExportFormat.INLINE, model.format()); - Assertions.assertEquals("cwrwclxxwrljdous", model.value()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaInnerTests.java deleted file mode 100644 index de564bec22fb..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.MetadataSchemaInner; -import com.azure.resourcemanager.apicenter.models.MetadataAssignment; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetadataSchemaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataSchemaInner model = BinaryData.fromString( - "{\"properties\":{\"schema\":\"bzqqedqytbciq\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":false,\"deprecated\":false},{\"entity\":\"api\",\"required\":false,\"deprecated\":true}]},\"id\":\"lougpbkw\",\"name\":\"mutduqktaps\",\"type\":\"wgcu\"}") - .toObject(MetadataSchemaInner.class); - Assertions.assertEquals("bzqqedqytbciq", model.properties().schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, model.properties().assignedTo().get(0).entity()); - Assertions.assertEquals(false, model.properties().assignedTo().get(0).required()); - Assertions.assertEquals(false, model.properties().assignedTo().get(0).deprecated()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataSchemaInner model - = new MetadataSchemaInner().withProperties(new MetadataSchemaProperties().withSchema("bzqqedqytbciq") - .withAssignedTo(Arrays.asList( - new MetadataAssignment().withEntity(MetadataAssignmentEntity.DEPLOYMENT) - .withRequired(false) - .withDeprecated(false), - new MetadataAssignment().withEntity(MetadataAssignmentEntity.API) - .withRequired(false) - .withDeprecated(true)))); - model = BinaryData.fromObject(model).toObject(MetadataSchemaInner.class); - Assertions.assertEquals("bzqqedqytbciq", model.properties().schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, model.properties().assignedTo().get(0).entity()); - Assertions.assertEquals(false, model.properties().assignedTo().get(0).required()); - Assertions.assertEquals(false, model.properties().assignedTo().get(0).deprecated()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaListResultTests.java deleted file mode 100644 index fbcb1daba50a..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaListResult; - -public final class MetadataSchemaListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataSchemaListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"schema\":\"vkocrcjdkwtn\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":false,\"deprecated\":true},{\"entity\":\"api\",\"required\":false,\"deprecated\":true},{\"entity\":\"api\",\"required\":true,\"deprecated\":true},{\"entity\":\"api\",\"required\":true,\"deprecated\":false}]},\"id\":\"mppeebvmgxs\",\"name\":\"bkyqduu\",\"type\":\"itcjczdz\"},{\"properties\":{\"schema\":\"ndhkrw\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":false,\"deprecated\":true}]},\"id\":\"vwrwj\",\"name\":\"eusnhutj\",\"type\":\"ltmrldh\"},{\"properties\":{\"schema\":\"jzzd\",\"assignedTo\":[{\"entity\":\"environment\",\"required\":false,\"deprecated\":true},{\"entity\":\"deployment\",\"required\":false,\"deprecated\":false},{\"entity\":\"deployment\",\"required\":true,\"deprecated\":false},{\"entity\":\"api\",\"required\":true,\"deprecated\":true}]},\"id\":\"yiftyhxhuro\",\"name\":\"ftyxolniw\",\"type\":\"wcukjfkgiawxk\"},{\"properties\":{\"schema\":\"ypl\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":true,\"deprecated\":true},{\"entity\":\"environment\",\"required\":true,\"deprecated\":true}]},\"id\":\"bacphejko\",\"name\":\"ynqgoulzndlikwyq\",\"type\":\"gfgibm\"}],\"nextLink\":\"gakeqsr\"}") - .toObject(MetadataSchemaListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataSchemaListResult model = new MetadataSchemaListResult(); - model = BinaryData.fromObject(model).toObject(MetadataSchemaListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaPropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaPropertiesTests.java deleted file mode 100644 index 9787675e0b79..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemaPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.MetadataAssignment; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetadataSchemaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetadataSchemaProperties model = BinaryData.fromString( - "{\"schema\":\"rtumkdosvq\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":true,\"deprecated\":true}]}") - .toObject(MetadataSchemaProperties.class); - Assertions.assertEquals("rtumkdosvq", model.schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, model.assignedTo().get(0).entity()); - Assertions.assertEquals(true, model.assignedTo().get(0).required()); - Assertions.assertEquals(true, model.assignedTo().get(0).deprecated()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetadataSchemaProperties model = new MetadataSchemaProperties().withSchema("rtumkdosvq") - .withAssignedTo(Arrays.asList(new MetadataAssignment().withEntity(MetadataAssignmentEntity.DEPLOYMENT) - .withRequired(true) - .withDeprecated(true))); - model = BinaryData.fromObject(model).toObject(MetadataSchemaProperties.class); - Assertions.assertEquals("rtumkdosvq", model.schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, model.assignedTo().get(0).entity()); - Assertions.assertEquals(true, model.assignedTo().get(0).required()); - Assertions.assertEquals(true, model.assignedTo().get(0).deprecated()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 7a1b9d772648..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.MetadataAssignment; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchema; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadataSchemasCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"schema\":\"zdtmhrkwofy\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":true,\"deprecated\":false}]},\"id\":\"pbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetadataSchema response = manager.metadataSchemas() - .define("apvhelxprgly") - .withExistingService("jqg", "ysmocmbqfqvmkcxo") - .withProperties(new MetadataSchemaProperties().withSchema("dd") - .withAssignedTo(Arrays.asList( - new MetadataAssignment().withEntity(MetadataAssignmentEntity.ENVIRONMENT) - .withRequired(true) - .withDeprecated(true), - new MetadataAssignment().withEntity(MetadataAssignmentEntity.DEPLOYMENT) - .withRequired(true) - .withDeprecated(true), - new MetadataAssignment().withEntity(MetadataAssignmentEntity.ENVIRONMENT) - .withRequired(false) - .withDeprecated(true), - new MetadataAssignment().withEntity(MetadataAssignmentEntity.DEPLOYMENT) - .withRequired(true) - .withDeprecated(true)))) - .create(); - - Assertions.assertEquals("zdtmhrkwofy", response.properties().schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, - response.properties().assignedTo().get(0).entity()); - Assertions.assertEquals(true, response.properties().assignedTo().get(0).required()); - Assertions.assertEquals(false, response.properties().assignedTo().get(0).deprecated()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteWithResponseMockTests.java deleted file mode 100644 index 3db1d614bcff..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadataSchemasDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.metadataSchemas() - .deleteWithResponse("yhrfouyftaakcpw", "yzvqt", "nubexk", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetWithResponseMockTests.java deleted file mode 100644 index 4b54ec2509bc..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasGetWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchema; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadataSchemasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"schema\":\"gx\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":false,\"deprecated\":true},{\"entity\":\"environment\",\"required\":false,\"deprecated\":false},{\"entity\":\"environment\",\"required\":false,\"deprecated\":false}]},\"id\":\"yqsluic\",\"name\":\"dggkzzlvmbmpa\",\"type\":\"modfvuefywsbpfvm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetadataSchema response = manager.metadataSchemas() - .getWithResponse("sotbob", "dopcjwvnh", "ld", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gx", response.properties().schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, - response.properties().assignedTo().get(0).entity()); - Assertions.assertEquals(false, response.properties().assignedTo().get(0).required()); - Assertions.assertEquals(true, response.properties().assignedTo().get(0).deprecated()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadWithResponseMockTests.java deleted file mode 100644 index 5876ddca32c7..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasHeadWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadataSchemasHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.metadataSchemas() - .headWithResponse("zksmondj", "quxvypomgkop", "whojvp", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListMockTests.java deleted file mode 100644 index c201b04657d8..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/MetadataSchemasListMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchema; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MetadataSchemasListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"schema\":\"pfuflrw\",\"assignedTo\":[{\"entity\":\"deployment\",\"required\":true,\"deprecated\":true},{\"entity\":\"deployment\",\"required\":true,\"deprecated\":false},{\"entity\":\"api\",\"required\":false,\"deprecated\":true},{\"entity\":\"environment\",\"required\":false,\"deprecated\":true}]},\"id\":\"fb\",\"name\":\"vkcvqvpkeqd\",\"type\":\"vdrhvoo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.metadataSchemas().list("ljuti", "swacffgdkzz", "wkfvhqcrailvp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pfuflrw", response.iterator().next().properties().schema()); - Assertions.assertEquals(MetadataAssignmentEntity.DEPLOYMENT, - response.iterator().next().properties().assignedTo().get(0).entity()); - Assertions.assertEquals(true, response.iterator().next().properties().assignedTo().get(0).required()); - Assertions.assertEquals(true, response.iterator().next().properties().assignedTo().get(0).deprecated()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OnboardingTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OnboardingTests.java deleted file mode 100644 index ce0dea7a157d..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OnboardingTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.Onboarding; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OnboardingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Onboarding model - = BinaryData.fromString("{\"instructions\":\"uhpigvp\",\"developerPortalUri\":[\"gqgitxmedjvcsl\"]}") - .toObject(Onboarding.class); - Assertions.assertEquals("uhpigvp", model.instructions()); - Assertions.assertEquals("gqgitxmedjvcsl", model.developerPortalUri().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Onboarding model - = new Onboarding().withInstructions("uhpigvp").withDeveloperPortalUri(Arrays.asList("gqgitxmedjvcsl")); - model = BinaryData.fromObject(model).toObject(Onboarding.class); - Assertions.assertEquals("uhpigvp", model.instructions()); - Assertions.assertEquals("gqgitxmedjvcsl", model.developerPortalUri().get(0)); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationDisplayTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationDisplayTests.java deleted file mode 100644 index f3710a18d404..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationInnerTests.java deleted file mode 100644 index 62308985b09a..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.OperationInner; -import com.azure.resourcemanager.apicenter.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationListResultTests.java deleted file mode 100644 index c41799a82577..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationsListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationsListMockTests.java deleted file mode 100644 index 8840181ef93f..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"qwwncw\",\"isDataAction\":false,\"display\":{\"provider\":\"ktrmgucnapkt\",\"resource\":\"ellwptfdy\",\"operation\":\"fqbuaceopzf\",\"description\":\"hhuao\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceInnerTests.java deleted file mode 100644 index 5c1c85965c2b..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.ServiceInner; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.ServiceProperties; -import com.azure.resourcemanager.apicenter.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ServiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\"},\"identity\":{\"principalId\":\"3e497f91-f6f6-4c81-b637-477e5789564f\",\"tenantId\":\"8b2af61a-71c8-42db-a48f-ce04f8dfca27\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ryffdfdosy\":{\"principalId\":\"901d5bf1-4bf7-4641-a7d3-c77833d0e322\",\"clientId\":\"886d5863-5585-4a4b-a6d0-8a6969526961\"},\"paojakhmsbzjh\":{\"principalId\":\"f1cd2b44-6257-4bd8-aad1-e0bd058372ff\",\"clientId\":\"79575443-b10c-4b29-93d2-5025f109fe77\"},\"evdphlxaol\":{\"principalId\":\"1a686c5d-487d-4509-9768-be99c1242a57\",\"clientId\":\"0fa62078-33c6-486b-a29e-59a9f75aa815\"},\"trg\":{\"principalId\":\"8dc833dd-0820-430b-8790-a4873e76030c\",\"clientId\":\"a81b738d-bff9-4a2d-9c59-096bf28a552f\"}}},\"location\":\"bpf\",\"tags\":{\"wzo\":\"inzgvfcj\"},\"id\":\"xjtfelluwfzit\",\"name\":\"np\",\"type\":\"qfpjk\"}") - .toObject(ServiceInner.class); - Assertions.assertEquals("bpf", model.location()); - Assertions.assertEquals("inzgvfcj", model.tags().get("wzo")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceInner model = new ServiceInner().withLocation("bpf") - .withTags(mapOf("wzo", "inzgvfcj")) - .withProperties(new ServiceProperties()) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("ryffdfdosy", new UserAssignedIdentity(), "paojakhmsbzjh", new UserAssignedIdentity(), - "evdphlxaol", new UserAssignedIdentity(), "trg", new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(ServiceInner.class); - Assertions.assertEquals("bpf", model.location()); - Assertions.assertEquals("inzgvfcj", model.tags().get("wzo")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceListResultTests.java deleted file mode 100644 index dfaf9e2bbed1..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ServiceListResult; - -public final class ServiceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"7307eca8-7d8b-498c-8d38-89cfb99fb911\",\"tenantId\":\"181cb1ec-d13b-4165-94ed-946b7bc139fb\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"fpikxwczb\":{\"principalId\":\"1feec7f6-6a77-4b03-b753-0fa29653e8d8\",\"clientId\":\"48be5c1a-00b8-42fa-8843-a133b0eabfd1\"},\"npqxuh\":{\"principalId\":\"a89199cb-1697-45a3-b5f2-636ab70e7420\",\"clientId\":\"e65d261e-ef1b-48b7-aa34-25a384a8fb2b\"},\"qniwbybrkxvdumj\":{\"principalId\":\"0468e433-ae64-4559-8271-9b63bd206d3f\",\"clientId\":\"afd44bbe-ebf0-4e0c-a553-1e561ffae43e\"},\"fwvuk\":{\"principalId\":\"43f0617c-a850-4526-b578-073c27928064\",\"clientId\":\"f2f7b24f-fdcb-4fe8-8b72-56c7c5e30538\"}}},\"location\":\"audccsnhs\",\"tags\":{\"yhtnapczwlokjye\":\"yejhk\",\"jnchgej\":\"kkvnipjox\",\"huxinpmqnj\":\"podmailzydehojwy\",\"vcputegj\":\"qwixjspro\"},\"id\":\"wmfdatscmdvpjhul\",\"name\":\"uuvmkjozkrwfnd\",\"type\":\"odjpslwejd\"}],\"nextLink\":\"wryoqpsoacc\"}") - .toObject(ServiceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceListResult model = new ServiceListResult(); - model = BinaryData.fromObject(model).toObject(ServiceListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicePropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicePropertiesTests.java deleted file mode 100644 index 8e3cd4e273f5..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicePropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ServiceProperties; - -public final class ServicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceProperties model - = BinaryData.fromString("{\"provisioningState\":\"Canceled\"}").toObject(ServiceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceProperties model = new ServiceProperties(); - model = BinaryData.fromObject(model).toObject(ServiceProperties.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceUpdateTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceUpdateTests.java deleted file mode 100644 index ae5e84a6aca4..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServiceUpdateTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.ServiceUpdate; -import com.azure.resourcemanager.apicenter.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ServiceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceUpdate model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"f6e41e0c-a573-4c4c-b4f0-71d513833bf5\",\"tenantId\":\"8c940a9e-a8b7-40ce-b71f-e5e8ebd44bda\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ygxgispemvtz\":{\"principalId\":\"91582c6e-7d9f-4302-8199-02ed34ed9bb0\",\"clientId\":\"ec3d6ac1-2dd2-45c3-a247-e61d644428d1\"},\"fublj\":{\"principalId\":\"e8b32a6b-e067-4831-b3cd-433afb85429b\",\"clientId\":\"69ca93f4-b52c-453b-bcd4-8f9f61b57bad\"},\"qeof\":{\"principalId\":\"0fd18af9-a4b6-41cf-8dfb-578fe0e7d155\",\"clientId\":\"ea031080-de0a-4694-9636-64418fa57fc4\"}}},\"tags\":{\"msmjqulngsntn\":\"qjhqjbas\"}}") - .toObject(ServiceUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("qjhqjbas", model.tags().get("msmjqulngsntn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceUpdate model = new ServiceUpdate() - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("ygxgispemvtz", new UserAssignedIdentity(), "fublj", - new UserAssignedIdentity(), "qeof", new UserAssignedIdentity()))) - .withTags(mapOf("msmjqulngsntn", "qjhqjbas")); - model = BinaryData.fromObject(model).toObject(ServiceUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("qjhqjbas", model.tags().get("msmjqulngsntn")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 617d1d3ea0ea..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentity; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.Service; -import com.azure.resourcemanager.apicenter.models.ServiceProperties; -import com.azure.resourcemanager.apicenter.models.UserAssignedIdentity; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"8b369e7c-f2df-4b0a-b3e6-54af5b086ed0\",\"tenantId\":\"28bf0f77-43f0-41ab-a318-278e969c0479\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"mubyynt\":{\"principalId\":\"b83e0951-434b-4b45-9c09-b1535a375fd8\",\"clientId\":\"b6b414d8-cbf3-417a-8ce5-5787ac2d40db\"},\"bqtkoievseotgqr\":{\"principalId\":\"3a2bda92-0819-4564-a2ee-d5bf37ef9c17\",\"clientId\":\"8f340e50-450b-4bba-bd85-ff1a015d908f\"},\"muwlauwzizxbm\":{\"principalId\":\"8efa50ee-a589-4198-895e-0ffa46c82a62\",\"clientId\":\"880c22a1-6609-4bdd-adb1-4c042d97f583\"}}},\"location\":\"cjefuzmu\",\"tags\":{\"bhjpglkfgohdne\":\"ttdumorppxebmnzb\",\"phsdyhto\":\"el\",\"v\":\"fikdowwqu\"},\"id\":\"zx\",\"name\":\"lvithhqzonosgg\",\"type\":\"hcohfwdsjnk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Service response = manager.services() - .define("vwiwubmwmbesld") - .withRegion("ikvmkqzeqqk") - .withExistingResourceGroup("tshhszhedp") - .withTags(mapOf("bdagxt", "fzxmhhvhgureodkw")) - .withProperties(new ServiceProperties()) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("ogaok", new UserAssignedIdentity(), "m", new UserAssignedIdentity()))) - .create(); - - Assertions.assertEquals("cjefuzmu", response.location()); - Assertions.assertEquals("ttdumorppxebmnzb", response.tags().get("bhjpglkfgohdne")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteByResourceGroupWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index c1ec553c245f..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.services().deleteByResourceGroupWithResponse("dzu", "erscdntne", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaMockTests.java deleted file mode 100644 index 7ada4c7c9467..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesExportMetadataSchemaMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.MetadataAssignmentEntity; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportFormat; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportRequest; -import com.azure.resourcemanager.apicenter.models.MetadataSchemaExportResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesExportMetadataSchemaMockTests { - @Test - public void testExportMetadataSchema() throws Exception { - String responseStr = "{\"format\":\"inline\",\"value\":\"n\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MetadataSchemaExportResult response = manager.services() - .exportMetadataSchema("fiwjmygtdssls", "tmweriofzpyq", - new MetadataSchemaExportRequest().withAssignedTo(MetadataAssignmentEntity.ENVIRONMENT), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(MetadataSchemaExportFormat.INLINE, response.format()); - Assertions.assertEquals("n", response.value()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index d380e6c5fa2e..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.Service; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\"},\"identity\":{\"principalId\":\"682b9801-40b0-4a5c-8a95-99e90924506a\",\"tenantId\":\"8f62dbce-67b5-4351-8254-8af3aa46d033\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"uhavhql\":{\"principalId\":\"d2351eca-5662-4c3d-9e1d-87a650ec19c2\",\"clientId\":\"4f13496d-1cc9-4c4c-9c5a-287d2ba1cc28\"},\"umaq\":{\"principalId\":\"2490db57-d519-49cc-8bc6-a4308962fa2a\",\"clientId\":\"879e5f25-2eba-4767-b6fc-f1d485025498\"}}},\"location\":\"bgycduiertgccym\",\"tags\":{\"ssl\":\"l\",\"d\":\"lfmmdnbbglzpswi\",\"bzmnvdfznud\":\"cwyhzdxssa\"},\"id\":\"od\",\"name\":\"xzb\",\"type\":\"cblylpstdbhhxsr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Service response = manager.services() - .getByResourceGroupWithResponse("doy", "mifthnzdnd", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bgycduiertgccym", response.location()); - Assertions.assertEquals("l", response.tags().get("ssl")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupMockTests.java deleted file mode 100644 index 28b90aade345..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesListByResourceGroupMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.Service; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"identity\":{\"principalId\":\"584c9885-f9c4-462d-8a39-f53aff98b1a6\",\"tenantId\":\"dcd1eabe-323b-423b-b72f-e87e25603b0e\",\"type\":\"None\",\"userAssignedIdentities\":{\"hqjohxcrsbfova\":{\"principalId\":\"129d7b68-7bc3-41da-aa94-92f1a997435e\",\"clientId\":\"18cc121e-5385-4a2e-a265-65b78c0ff658\"},\"uvwbhsqfs\":{\"principalId\":\"a4455b9b-d1ef-4c5b-8a83-f0affb30223d\",\"clientId\":\"a6fbcf9b-02f7-44d3-9c72-1ff001d1fab6\"},\"gjb\":{\"principalId\":\"6342df61-9701-45c2-a37e-9d18f6e9b885\",\"clientId\":\"d579f3d6-0cb7-4689-861c-6cd84596d2ab\"}}},\"location\":\"xb\",\"tags\":{\"t\":\"srfbjfdtwss\",\"vwpm\":\"tpvjzbexilzznfqq\"},\"id\":\"taruoujmkcj\",\"name\":\"wqytjrybnwjewgdr\",\"type\":\"ervnaenqpehi\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.services().listByResourceGroup("ytkblmpew", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xb", response.iterator().next().location()); - Assertions.assertEquals("srfbjfdtwss", response.iterator().next().tags().get("t")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesListMockTests.java deleted file mode 100644 index 378bf2bc1ccc..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/ServicesListMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.apicenter.models.Service; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"ab0eb03e-4c2a-4aca-a957-4975479bc490\",\"tenantId\":\"2d3c2fc9-37a3-418b-9a27-77ea626451a0\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ctobg\":{\"principalId\":\"fa16011e-4b19-41aa-90c5-45baa694dd21\",\"clientId\":\"9c126cfd-3fc2-4b00-a4db-2a08253a5405\"},\"moizpos\":{\"principalId\":\"6eeabd15-9a6f-461e-91fb-85f836845d5e\",\"clientId\":\"58a420bc-6b95-4019-9894-005157fffa85\"}}},\"location\":\"grcfb\",\"tags\":{\"jy\":\"mfqjhhkxbp\",\"u\":\"jhxxjyn\",\"xqzvszjfa\":\"ivkrtsw\",\"ivetvtcq\":\"vjfdx\"},\"id\":\"qtdo\",\"name\":\"mcbxvwvxysl\",\"type\":\"bhsfxob\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.services().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("grcfb", response.iterator().next().location()); - Assertions.assertEquals("mfqjhhkxbp", response.iterator().next().tags().get("jy")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/TermsOfServiceTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/TermsOfServiceTests.java deleted file mode 100644 index 436752c0352c..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/TermsOfServiceTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.TermsOfService; -import org.junit.jupiter.api.Assertions; - -public final class TermsOfServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TermsOfService model = BinaryData.fromString("{\"url\":\"hocohslkev\"}").toObject(TermsOfService.class); - Assertions.assertEquals("hocohslkev", model.url()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TermsOfService model = new TermsOfService().withUrl("hocohslkev"); - model = BinaryData.fromObject(model).toObject(TermsOfService.class); - Assertions.assertEquals("hocohslkev", model.url()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/UserAssignedIdentityTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/UserAssignedIdentityTests.java deleted file mode 100644 index b1785134097f..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"0ed8fb1e-6f3d-41c6-8490-13ece48b03cd\",\"clientId\":\"e542e92f-b14b-44ec-8210-31085ecc3c92\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspaceInnerTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspaceInnerTests.java deleted file mode 100644 index b509af569f5a..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspaceInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.apicenter.models.WorkspaceProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceInner model = BinaryData.fromString( - "{\"properties\":{\"title\":\"gjvtbv\",\"description\":\"sszdnru\"},\"id\":\"guhmuouqfpr\",\"name\":\"zw\",\"type\":\"nguitnwuizgazxu\"}") - .toObject(WorkspaceInner.class); - Assertions.assertEquals("gjvtbv", model.properties().title()); - Assertions.assertEquals("sszdnru", model.properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceInner model = new WorkspaceInner() - .withProperties(new WorkspaceProperties().withTitle("gjvtbv").withDescription("sszdnru")); - model = BinaryData.fromObject(model).toObject(WorkspaceInner.class); - Assertions.assertEquals("gjvtbv", model.properties().title()); - Assertions.assertEquals("sszdnru", model.properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspaceListResultTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspaceListResultTests.java deleted file mode 100644 index d9ab62c12a48..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspaceListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.WorkspaceListResult; - -public final class WorkspaceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"title\":\"ex\",\"description\":\"bhtqqrolfpfpsa\"},\"id\":\"bquxigjy\",\"name\":\"gzjaoyfhrtxilne\",\"type\":\"kujysvlejuvfq\"}],\"nextLink\":\"rlyxwjkcprbnw\"}") - .toObject(WorkspaceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceListResult model = new WorkspaceListResult(); - model = BinaryData.fromObject(model).toObject(WorkspaceListResult.class); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacePropertiesTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacePropertiesTests.java deleted file mode 100644 index dc5c677c0e18..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.apicenter.models.WorkspaceProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkspacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceProperties model - = BinaryData.fromString("{\"title\":\"izuckyfihrfidfvz\",\"description\":\"zuhtymwisdkfthwx\"}") - .toObject(WorkspaceProperties.class); - Assertions.assertEquals("izuckyfihrfidfvz", model.title()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceProperties model - = new WorkspaceProperties().withTitle("izuckyfihrfidfvz").withDescription("zuhtymwisdkfthwx"); - model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); - Assertions.assertEquals("izuckyfihrfidfvz", model.title()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index f795ed1e42b1..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Workspace; -import com.azure.resourcemanager.apicenter.models.WorkspaceProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"sorgj\",\"description\":\"bldtlww\"},\"id\":\"kdmtncvokotll\",\"name\":\"d\",\"type\":\"h\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Workspace response = manager.workspaces() - .define("ntorzihleosjswsr") - .withExistingService("n", "jphuopxodlqi") - .withProperties(new WorkspaceProperties().withTitle("lyzrpzbchckqqzqi").withDescription("iysui")) - .create(); - - Assertions.assertEquals("sorgj", response.properties().title()); - Assertions.assertEquals("bldtlww", response.properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteWithResponseMockTests.java deleted file mode 100644 index c31691fc4270..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().deleteWithResponse("jfqka", "e", "iipfpubj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetWithResponseMockTests.java deleted file mode 100644 index d7947fa66fac..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Workspace; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"title\":\"xywsuws\",\"description\":\"s\"},\"id\":\"sytgadgvraea\",\"name\":\"neqn\",\"type\":\"arrwlquu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Workspace response = manager.workspaces() - .getWithResponse("h", "pkkpw", "reqnovvqfov", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xywsuws", response.properties().title()); - Assertions.assertEquals("s", response.properties().description()); - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadWithResponseMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadWithResponseMockTests.java deleted file mode 100644 index bf106719d652..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesHeadWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesHeadWithResponseMockTests { - @Test - public void testHeadWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaces().headWithResponse("bwwift", "hqkvpuvksgplsak", "ynfs", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListMockTests.java b/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListMockTests.java deleted file mode 100644 index 9ec3f8dba57c..000000000000 --- a/sdk/apicenter/azure-resourcemanager-apicenter/src/test/java/com/azure/resourcemanager/apicenter/generated/WorkspacesListMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.apicenter.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.apicenter.ApiCenterManager; -import com.azure.resourcemanager.apicenter.models.Workspace; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class WorkspacesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"byuqerpqlp\",\"description\":\"cciuqgbdbutau\"},\"id\":\"btkuwhh\",\"name\":\"hykojoxafnndlpic\",\"type\":\"koymkcd\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ApiCenterManager manager = ApiCenterManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.workspaces().list("kcnqxwbpo", "ulpiuj", "aasipqi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("byuqerpqlp", response.iterator().next().properties().title()); - Assertions.assertEquals("cciuqgbdbutau", response.iterator().next().properties().description()); - } -}